Extended Date Time Format
Official Web Site  

 

References and Notes

[1] xs:date

The W3C XML schema language defines a data type 'xs:date' to represents a day, in terms of year, month, and day of month: 'yyyy-mm-dd'

(Technically it can take the form 'yyyy-mm-ddzzzzzz' where 'zzzzzz' is an optional time zone designator. However the purpose of the time zone designator for a day is not clear.)

The year is four or more digits which may be preceded by a minus sign (cannot begin with a plus (+) sign). Thus:

  • 0001 is the year 1 AD.
  •  -0001 is 1 BC.
  • 0000 cannot be used.

If the value is more than four digits, it may not have leading zeroes.

Examples:

  • 2008-02-03
    February 3, 2008
  • 10000-01-01
    January 1 of the year 10,000
  • -10000-01-01
    January 1 of the year 10,000 BC

[2] xs:time

The W3C XML schema language defines a data type 'xs:date', representing an instant of time in the form of hour, minute, second, and time zone offset: 'hh:mm:ss.sssssszzzzzz'

A value of 24 for the hour is allowed only when the minutes and seconds are both zero. 24:00:00 is treated as 00:00:00 of the following day.

Seconds may be simply two digits, or may include a decimal portion of 1-to-6 digits representing the fractional portion, preceded by period.

The optional time zone indicator is preceded by a plus or minus, for "earlier" or "later" than UTC time.

For example 14:30:00-05:00 represents 2:30PM US Eastern time (which is 5 hours earlier than UTC.

The form of the time zone representation is 'hh:mm' for hours and seconds. Normally, 'mm' is "00", however some countries have defined time zones that differ from adjacent time zones by 30 minutes.

[3] xs:dateTime

The W3C XML schema language also defines a data type 'xs:dateTime', representing an instant in time, in terms of date and time where date and time are represented as xs:date and xs:time as described above, and they are separated by 'T".

Example: 2008-12-02T11:30:00-05:00 represents 11:30 US Eastern time on December 2, 2008.

[4] W3CDTF

W3CDTF is an Note published by the W3C, which defines a profile of ISO 8601 (discussed below). Its premise is that ISO 8601 is overly complex, describing many date/time formats, and that it is useful to restrict the supported formats to a small number, a set likely to satisfy most requirements.

The Note, though published by W3C, is not endorsed by W3C, and it contains a W3C disclaimer to that effect. Nevertheless it is used by metadata schemes, for example Dublin Core. W3CDTF prescribes the following formats:

  • Year: (four-digit) YYYY e.g. 2004
  • Year and month: YYYY-MM e.g. 2004-07
  • Date: YYYY-MM-DD e.g. 2004-07-04
  • Date plus hours and minutes: YYYY-MM-DDThh:mmTZD e.g. 2004-07-04T18:00-05:00
  • Date plus hours, minutes and seconds:  YYYY-MM-DDThh:mm:ssTZD e.g. 2004-07-04T18:00:30-05:00
  • Date plus hours, minutes, seconds and a decimal fraction of a second YYYY-MM-DDThh:mm:ss.sTZD e.g. 2004-07-04T18:00:30.25-05:00

[5] TEMPER

TEMPER (Temporal Enumerated Ranges) is an Internet Draft which addresses some of these concerns and was considered as a possible solution. However TEMPER diverges considerably from ISO 8601, to the extent that a solution based on the proposed approach (i.e. compatibility with ISO 8601), using TEMPER, is not possible. However, the proposed solution does use mechanisms similar to TEMPER where appropriate.

[6] ISO 8601

The International Standard for the representation of dates and times: "Data elements and interchange formats — Information interchange — Representation of dates and times."