Date and Time Formats

This specification uses the date and time format specified in the ISO 8601 standard. The specification includes five time-related compound data types: YrMon, Date, Time, DateTime, and Timestamp. In all types that describe Date information, the specification uses the Gregorian calendar. Data types including time information refer to a 24-hour clock.

There is one format for representing dates, times, and time zones. The complete form is:

YYYY-MM-DDTHH:mm:ss.ffffff±HH:mm

where all punctuation and the T are literal characters; “YYYY” represents a four-digit year; “MM” represents a two-digit month; “DD” represents a two-digit date; the first “HH” represents a two-digit, 24-hour format hour; the first “mm” represents a two-digit minute; “ss” represents a two-digit second; and “ffffff” represents fractional seconds, and may be of any length. The second “HH” and “mm” describe the time zone offset from coordinated universal time (UTC), in hours and minutes, respectively. The “±” can be either a “+” or a “-” depending on whether the time zone offset is positive or negative.

All date and time types include (with the largest units given first) year, month, day, hour, minute, second, and fractions of a second. Any particular type may include a subset of these possible values. Types including time information (hour, minute, and so on) may also include an offset from Coordinated Universal Time (UTC).

Note: In a DateTime element, specifying a date without a time or time zone will result in a time of midnight, UTC. This will result in the previous date appearing for all time zones in the Western Hemisphere. For example, October 5, 2002, without a specified time zone offset, will appear to be October 5, 2002, for the Eastern Hemisphere, but October 4, 2002, for the Western Hemisphere. Therefore, for DateTime elements where a single date is desired worldwide, the time must be included, and it must result in noon, UTC (for example, “12:00:00” or “09:00:00-03:00”).

As a general rule for date and time compound data types, values may be entered that omit the smallest logical elements. In every case, the value is taken to mean the same thing as if the minimum values (such as zeros) were included. (The default is always the start of an otherwise ambiguous range for types other than YrMon.) For example, a DateTime value omitting the time portion means the start of the day (12:00 midnight). Note that time zone qualifiers (in time and DateTime values) are exceptions to this rule, as they may be included even if times are not specified to the millisecond.

The logical elements appearing in each of these compound data types are summarized in the following table. “Required” means that the element must occur in all instances of the data type. “Recommended” means that the element should be included in all instances of the data type. “Optional” elements may be omitted from an instance of the data type. Optional elements must be included if smaller elements are to be included. For example, month must not be omitted from a date value if day is included.

Contains YrMon Date Time DateTime Timestamp

Year

YYYY

0000-9999

Required

Required

N/A

Required

Required

Month

MM

01-12

Required

Optional

N/A

Required

Required

Day

DD

01-31

N/A

Optional

N/A

Required

Required

Hours

HH

0-23

N/A

N/A

Required

Optional

Required

Minutes

MM

0-59

N/A

N/A

Optional

Optional

Required

Seconds

SS

0-60

N/A

N/A

Optional

Optional

Required

Fractional Seconds

XXX (minimum)

Precision is determined by the implementation

N/A

N/A

Optional

Optional

Optional

UTC offset (time zone indication)

Hours/Minutes

-12:59 to +12:59

N/A

N/A

Recommended

Recommended

Recommended