Necesito escribir un guión:
startdate = 2016-02-14 20:10:10
enddate = 2016-02-14 23:59:59
c= 1240 (minutes)
d=10
r = ratio(startdate - enddate) / c;
d=d*r;
¿Cómo calcular la diferencia entre la fecha de inicio y la fecha de finalización?
Respuesta1
Para calcular segundos entre dos tiempos:
#!/bin/bash
START="2016-02-14 20:10:10"
END="2016-02-14 23:59:59"
SECS=$(echo $(date -d "$END" +%s) - $(date -d "$START" +%s) | bc)
echo $SECS