[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: XML message format draft
> As for time format, I'd like to move to a generic ISO8601-based form per
> RFC 3339 [1] or XML schema [2].
>
> #g
> --
>
> [1] http://www.ietf.org/rfc/rfc3339.txt
>
> [2] http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dateTime
Agreed.
I would suggest that we define a datetime which:
1. Is a subset of those allowed in the two works cited above, and also in
NOTE-datetime <http://www.w3.org/TR/NOTE-datetime> (commonly referred to as
W3CDTF), and as such also compatible with Dublin Core's W3CDTF (which is
just a reuse of the former, with a DC-supplied URI).
2. Had the same range and precision as that used in RFC2822.
3. Was always expressed in terms of UTC/GMT.
As such we would have a datetime format expressed as the following ABNF:
date-time = full-date "T" UTC-time
full-date = date-fullyear "-" date-month "-" date-mday
date-fullyear = 4DIGIT
date-month = 2DIGIT ; 01-12
date-mday = 2DIGIT ; 01-31
UTC-time = time-hour ":" time-minute ":" time-second "Z"
time-hour = 2DIGIT ; 00-23
time-minute = 2DIGIT ; 00-59
time-second = 2DIGIT ; 00-60
This format can be used correctly by systems expecting W3C-DTF,
http://www.w3.org/TR/xmlschema-2/#dateTime or RFC3339, covers the same
value-range as RFC2822 and forces the use of UTC which simplifies coding and
reduces ambiguity.
I'd recommend we make the "T" and "Z" something that MUST be send
upper-case, but SHOULD be accepted in either-case.
It can be expressed as the following XML Schema:
<xs:simpleType name="toBeDecided" id="toBeDecided">
<xs:restriction base="xs:dateTime">
<xs:pattern
value="[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:T[0-9]{2}:T[0-9]{2}Z"/>
</xs:restriction>
</xs:simpleType>
The pattern is looser than the BNF above for simplicity sake, when combined
with the fact that it must also be valid as an xs:dateTime it would be
equivalent to that BNF.