How to get the difference between two date/times, and convert it to action XML scheduling format

Here is a new method I just came up with once I discovered the “Format” inspector: https://bigfix.me/relevance/details/3008616

Q: ( format "P{0}DT{1}H{2}M{3}S" + it / (1*day) of it + it mod (1*day) / (1*hour) + it mod (1*hour) / (1*minute) + it mod (1*minute) / (1*second) ) of ("26 days, 18:36:56" as time interval)
A: P26DT18H36M56S

This relevance converts a time interval object into a formatted string for use in action start & end times, which are in the StartDateTimeLocalOffset or EndDateTimeLocalOffset XML.


Related:

3 Likes