I have two time strings; eg. \"09:11\" and \"17:22\" on the same day (format is hh:mm). How do I calculate the time difference in minutes between these two?
Can the
STARTTIME=$(date +%s)
YOUR CODES :
ENDTIME=$(date +%s) secs=$(($ENDTIME - $STARTTIME)) printf 'Elapsed Time %dh:%dm:%ds\n' $(($secs/3600)) $(($secs%3600/60)) $(($secs%60))