Article 5DYS6 Difference between two time durations

Difference between two time durations

by
ychaouche
from LinuxQuestions.org on (#5DYS6)
Dear #LQ,

This is not necessarily a programming question, any command that does the trick is welcome, the trick being how to calculate the difference between two time durations like 01:20:50 - 00:50:27 ? Best I could come up with was with the dateutils.ddif command

Code:ychaouche#ychaouche-PC 10:03:40 ~ $ dateutils.ddiff -f "%H:%M:%S" "01:50:00" "00:27:00"
-1:-23:0
ychaouche#ychaouche-PC 10:03:47 ~ $But as you can see I couldn't get proper formatting (ideally, the output would look like so : 01:23:00)latest?d=yIl2AUoC8zA latest?i=mlBZB5rRchM:vhJiep6NK0E:F7zBnMy latest?i=mlBZB5rRchM:vhJiep6NK0E:V_sGLiP latest?d=qj6IDK7rITs latest?i=mlBZB5rRchM:vhJiep6NK0E:gIN9vFwmlBZB5rRchM
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments