If we accept that there are various standard ways to represent times and dates, is there a standard way to present a time-span or time-delta? I would add the requirement that the presentation of the time-span should also be amenable to parsing.
For example is Days/HH:MM:SS.FFFFFF (E.g. 3/14:12:04.201000 ) acceptable? With HH : Hours, MM : Minutes, SS : Seconds, FFFFFFF fraction of a second.
ISO 8601 defines durations of the form
P...Y...M...DT...H...M...S
where ...
are numbers and
Components with value 0 can be left out as long as there is at least one component (e.g. PT5S
denotes 5 seconds). The least significant component can have a fractional value (e.g. PT0.5H
denotes half an hour = 30 minutes).
However, ISO 8601 defined these durations for specifying time intervals of the form start_date_time + duration
. Depending on the start date and time, the length of every component but S
might vary.
See also What is the value of the ISO 8601 duration `P1M` (in seconds)?. ISO 8601 mentiones that some applications may fix durations like P1M
= P30D
and so on, but does not define it at all.
To work around these interpretation problems, you could use seconds only, e.g. PT3600S
instead of PT1H
(the standard does not enforce carry-over points like 60s, 24h and so on). However, that seems pretty pointless. I'd rather just use the number in seconds without PT
and S
(unix-time style) or switch to a non-standardized (?) but abundant format like you suggested (video timestamps).