The primitive type xs:date
represents a date of the Gregorian calendar. The lexical representation of xs:date
is YYYY-MM-DD
where YYYY
represents the year, MM
the month, and DD
the day. The year value has to be at least four digits, but it can be more than four digits to represent years later than 9999. However, XQuery implementations are not required to support more than four digits. A preceding minus sign (-) can be used to represent years before 0001. A time zone can be added to the end, as described in "Time Zones" in Chapter 19.
Values of type xs:date
can be cast to and from xs:dateTime
,
as described in the section on xs:dateTime
. You can obtain the current date using the current-date
function, which returns a value of type xs:date
.
Table B-3 lists some values of the xs:date
type. For more information on working with dates, see Chapter 19.
Table B-3. Values of the xs:date type
18.191.62.122