%ents; ]>
Jabber Date and Time Profiles This JEP specifies a standardization of ISO 8601 profiles and their lexical representation for use in Jabber/XMPP protocol extensions. &LEGALNOTICE; 0082 Active Informational Standards JIG XMPP Core ISO 8601 XML Schema Part 2 N/A &stpeter; 1.0 2003-05-28 psa Per a vote of the Jabber Council, advanced status to Active. 0.6 2003-05-22 psa Added examples; added section on migration. 0.5 2003-05-19 psa Adjusted wording regarding several XML Schema references; added implementation notes. 0.4 2003-05-16 psa Updated to refer to XML Schema datatypes; removed "Precise Datetime" profile; added "Time" profile for recurring events. 0.3 2003-05-08 psa Clarified registration format, deleted references to undocumented protocols, removed implementation notes. 0.2 2003-04-28 psa Added "Precise Datetime" profile. 0.1 2003-04-21 psa Initial version.

A number of Jabber protocols specify that dates and times should follow the format defined in &iso8601;. Unfortunately, ISO 8601 provides a great deal of flexibility with regard to the possible date and time "profiles" The concept of an ISO 8601 profile is used in both RFC 3339 (http://www.ietf.org/rfc/rfc3339.txt) and a W3C Note (http://www.w3.org/TR/NOTE-datetime). as well as their lexical representation. While that flexibility can lead to confusion, it is also true that the Jabber community has tended to use only a few restricted profiles of ISO 8601 dates and times (albeit with inconsistent lexical representations). This JEP formalizes those profiles and their lexical representation through reference to the datatypes defined in &w3xmlschema2;.

The following acronyms and characters are used herein to represent time-related concepts:

TermDefinition
CCYYfour-digit year portion of Date
MMtwo-digit month portion of Date
DDtwo-digit day portion of Date
-ISO 8601 separator among Date portions
TISO 8601 separator between Date and Time
hhtwo-digit hour portion of Time (00 through 23)
mmtwo-digit minutes portion of Time (00 through 59)
sstwo-digit seconds portion of Time (00 through 59)
:ISO 8601 separator among Time portions
.ISO 8601 separator between seconds and milliseconds
sssfractional second addendum to Time (MAY contain any number of digits)
TZDTime Zone Definition (either "Z" for UTC or "[+|-]hh:mm" for a specific time zone)

Three profiles are defined herein.

The Date profile defines a date without including the time of day. The lexical representation is as follows:

CCYY-MM-DD

This profile is equivalent to the 'date' datatype defined in XML Schema The 'date' datatype is defined at <http://www.w3.org/TR/xmlschema-2/#date>.. When an XML schema is used to define a Jabber protocol that uses this profile, the datatype MUST be an XML Schema 'date'. If there are differences between the description in this JEP and those in XML Schema, the latter overrule.

1776-07-04

The DateTime profile is used to specify a non-recurring moment in time to an accuracy of seconds (or, optionally, fractions of a second). The format is as follows:

CCYY-MM-DDThh:mm:ss[.sss]TZD

The Time Zone Definition is mandatory and MUST be either UTC (denoted by addition of the character 'Z' to the end of the string) or some offset from UTC (denoted by addition of '[+|-]' and 'hh:mm' to the end of the string). The fractions of a second are optional and MAY be ignored if included (although a Jabber protocol using the DateTime profile MAY require the fractions of a second).

This profile is equivalent to the 'dateTime' datatype defined in XML Schema The 'dateTime' datatype is defined at <http://www.w3.org/TR/xmlschema-2/#dateTime>.. When an XML schema is used to define a Jabber protocol that uses this profile, the datatype MUST be an XML Schema 'dateTime'. If there are differences between the description in this JEP and those in XML Schema, the latter overrule.

1969-07-21T02:56:15Z 1969-07-20T21:56:15-05:00

The Time profile is used to specify an instant of time that recurs (e.g., every day). The lexical representation is as follows:

hh:mm:ss[.sss][TZD]

The Time Zone Definition is optional; if included, it MUST be either UTC (denoted by addition of the character 'Z' to the end of the string) or some offset from UTC (denoted by addition of '[+|-]' and 'hh:mm' to the end of the string). The fractions of a second are optional and MAY be ignored if included (although a Jabber protocol using the DateTime profile MAY require the fractions of a second).

This profile is equivalent to the 'time' datatype defined in XML Schema The 'time' datatype is defined at <http://www.w3.org/TR/xmlschema-2/#time>.. When an XML schema is used to define a Jabber protocol that uses this profile, the datatype MUST be an XML Schema 'time'. If there are differences between the description in this JEP and those in XML Schema, the latter overrule.

16:00:00

Some existing Jabber protocols use a different lexical representation for datetimes than the representation defined in XML Schema and specified by this JEP. These are &jep0090;, &jep0091;, and &jep0009;. (The representation of dates in &jep0054; matches that specified herein.) These older protocols represent datetimes as follows:

CCYYMMDDThh:mm:ss

The primary standard notation recommended by ISO 8601 includes the separators ("-" for dates and ":" for times), although ISO 8601 allows omission of the separators for applications in which compactness is more important than human readability. It is arguable whether Jabber applications using 'jabber:iq:time' and 'jabber:x:delay' require such compactness, but these protocols are in wide use today and have been implemented using the format shown above. Therefore, applications receiving data in those namespaces SHOULD be liberal in what they accept by handling datetimes either in the "CCYYMMDDThh:mm:ss" format or in the lexical representation defined in XML Schema and specified by this JEP. Applications generating data in those namespaces SHOULD use the existing format ("CCYYMMDDThh:mm:ss"), and are effectively "grandfathered" with respect to the date and time formats defined herein. While eventually it would be good to deprecate the older datetime representation for these protocols, the schedule for such deprecation (if any) shall be specified in official JEPs for these older protocols.

Jabber-RPC is a special case, since the specification for &xmlrpc; includes only one example for datetimes, which is of the format "CCYYMMDDThh:mm:ss". Apparently many implementations of XML-RPC have taken this lexical representation as canonical, and do not support any other representation; because Jabber-RPC normally provides an interface to software that is outside the Jabber network, it is prudent for Jabber-RPC implementations to generate dates in the format shown in the XML-RPC specification, not that defined in this JEP.

New protocols approved by the Jabber Software Foundation MUST use the lexical representations defined in this JEP.

The 'date', 'dateTime', and 'time' datatypes defined in XML Schema address several "edge cases" such as dates before the year 0000 and after the year 9999, as well as odd timezones no longer in use; most Jabber applications can safely ignore these edge cases, since it is highly unlikely that a Jabber entity will generate such representations.

There are no security features or concerns related to this proposal.

This JEP requires no interaction with &IANA;.

This JEP requires no interaction with the ®ISTRAR;.