The date type xs:date represents an interval of exactly one day that begins on the first moment of a given day.

Lexical form

The lexical form of xs:date is a finite-length sequence of characters of the following form: yyyy-mm-ddzzzzzz. The following abbreviations describe this form:

  • yyyy
  • A four-digit numeral that represents the year.

The value cannot begin with a negative (-) sign or a plus (+) sign.

0001 is the lexical representation of the year 1 of the Common Era (also known as 1 AD).

The value cannot be 0000.

  • -
  • Separators between parts of the date.
  • mm
  • A two-digit numeral that represents the month.
  • dd
  • A two-digit numeral that represents the day.
  • zzzzzz
  • Optional. If present, represents the time zone.

Timezone indicator

The lexical form for the time zone indicator is a string that includes one of the following forms:

  • A positive (+) or negative (-) sign that is followed by hh:mm, where the following abbreviations are used:
    • hh
    • A two-digit numeral (with leading zeros as required) that represents the hours. The value must be between -14 and +14, inclusive.
    • mm
    • A two-digit numeral that represents the minutes. The value of the minutes property must be zero when the hours property is equal to 14.
    • +
    • Indicates that the specified time instant is in a time zone that is ahead of the UTC time by hh hours and mm minutes.
    • -
    • Indicates that the specified time instant is in a time zone that is behind UTC time by hh hours and mm minutes.
  • The literal Z, which represents the time in UTC (Z represents Zulu time, which is equivalent to UTC). Specifying Z for the time zone is equivalent to specifying +00:00 or -00:00.

Example

The following form indicates 10 October 2009, Eastern Standard Time in the United States:

2009-10-10-05:00Copy code

This date represents a UTC date of 2009-10-10T05:00:00Z.

Parent topic:

Date and time data types


https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/rzasp/rzasp_xsdate.htm