I am attempting to calculate some time differences in org time strings using
(time-subtract (org-parse-time-string "2018-04-16 Mon 14:00") (org-parse-time-string "2018-04-14 Sat 13:00")) => (0 0 1 2)
This seems to make sense. The two times are different by two days and one hour.
(time-subtract (org-parse-time-string "2018-04-16 Mon 14:00") (org-parse-time-string "2018-04-11 Wed 18:00")) => (-1 65535 999996 5)
This one doesn't come out as neatly. I would expect
(0 0 1 5).
Here is the documentation for
time-subtract is a built-in function in ‘C source code’. (time-subtract A B) Return the difference between two time values A and B, as a time value. Use ‘float-time’ to convert the difference into elapsed seconds. A nil value for either argument stands for the current time. See ‘current-time-string’ for the various forms of a time value.
If I try
float-time on the two examples above, I get
-3.999994078185409e-06, which implies to me that I'm doing something wrong.
The documentation on
current-time-string does not appear to be helpful. In particular it does not define the four fields producted by
What is going on here? How can I get a consistent time difference between two