shell - how to calculate the total minutes between two dates? -


this question has answer here:

can me calculate total minutes between below 2 dates.

date1= 2016-07-02 06:20:00

date2= 2016-07-04 15:00:00

the output should in number example date diff 5 hours means need output 5*60=300 minutes.

thanks, aaa

echo $((($(date -ud "$date2" +'%s') - $(date -ud "$date1" +'%s'))/60)) minutes  


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -