> >>> Pete Johnston <[log in to unmask]> 24/07/02 03:54:46 >>>
> W3CDTF doesn't cover all the bases for duration, and there isn't a
> scheme in the DCQ rec for "size"....
>
> However ISO 8601 does offer a solution for a duration of time.
> I'm only interpretting the wording in clause 5.5.3.2 of the 1988
> version (I don't have the 2000 version handy), but I assume 123
> seconds would be:
> PT0H2M3S
> ie Period (P), time component (T), 0 hours (0H), 2 minutes (2M),
> and 3 seconds (3S).
> It isn't clear if you must include the date components. If it is
> compulsory it would be:
> P0Y0M0DT0H2M3S
> NB: Fractions of seconds are not supported.
That was the basis of the XML Schema duration datatype I mentioned earlier.
It is documented at http://www.w3.org/TR/xmlschema-2/#duration and does
allow fractions of seconds. While ISO8601 defines each of the parts as an
integer, it also gives rules for the use of decimals in any of these parts.
The XML Schema duration is a subset of the ISO8601 format, which is
convenient as it reduces the number of possible encodings. In particular the
Schema datatype doesn't use the W(week) part, which can be reliably replaced
by 7D, allows decimals only on the S(second) part and only uses a period as
the decimal separator (8601 allows either a period or a comma).
Both ISO 8601 and the W3C duration allow you to omit any datepart with a
value of 0. If you omit all of the time dateparts you must also omit the
"T". If you have any of the time dateparts you must include the "T". You
must include at least one date part, so for an instantaneous duration (no
time) you can have "P0Y", "PT0S", "PT0.00S" or whatever, but you can't have
a lone "P".
> From previous discussions on this list, I have determined that
> you can use parts of ISO8601 and call them W3CDTF [1] even though
> they are not explicitly discussed in the W3CDTF note. For
> example ranges of dates like 1999-12-31/2000-01-01.
That is a format that uses W3CDTF rather than a W3CDTF format.
> Though, either way, the P notation isn't particularly
> elegant/readable. :-(
Really? I can't think of a clearer duration format that is as comprehensive.
|