NAME
TimeBetweenDatetimes — Return the absolute value of time between datetimes given.
SYNOPSIS
TimeBetweenDatetimes FirstDatetime SecondDatetime
DESCRIPTION
Return Value
Number of days, hours, minutes, and seconds in the form ddddThh:mm:ss.
Arguments
FirstDatetimeThe first of the two datetimes to find the amount of time between.
SecondDatetimeThe second of the two datetimes to find the amount of time between.
More Info
Return value is in the form ddddThh:mm:ss, where dddd is the number of total days, hh is hours, mm is minutes, and ss is seconds. (See example.)

Note that the return value will always be non-negative, no matter whether the first or second datetime comes first.

Note that while this does return an absolute value result, the caller can also use DatetimeIsAfter to determine whether the first datetime is before or after the second. May want to do this to differentiate between when time has already gone past versus when it is still to come.


For information regarding exceptions / errors, see here.
EXAMPLES
% TimeBetweenDatetimes [Yesterday] [Today]
0001T00:00:00
% TimeBetweenDatetimes [Today] [Yesterday]
0001T00:00:00
SEE ALSO
TimeBetweenDates, TimeLeftUntilTargetDatetime
KEYWORDS
arithmetic, datetime