The primitive type xs:dateTime
represents a combined date and time. The lexical representation of xs:dateTime
is YYYY-MM-DDThh:mm:ss.sss
, which is a concatenation of the xs:date
and xs:time
representation, with an uppercase letter T
between them. The constraints described for the xs:date
and xs:time
types are also true for xs:dateTime
. A time zone can be added to the end, as described in "Time Zones" in Chapter 19.
Table B-4 lists some values of the xs:dateTime
type. For more information on working with dates and times, see Chapter 19.
Table B-4. Values of the xs:dateTime type
Values of type xs:dateTime
can be constructed using the standard xs:dateTime
constructor. In addition, a function named dateTime
can be used to construct an xs:dateTime
value from an xs:date
and an xs:time
. You can obtain the current date/time using the current-dateTime
function, which returns a value of type xs:dateTime
.
It is possible to cast some values to and from xs:dateTime
, as shown in the examples in Table B-5. You can split an xs:dateTime
value into its date and time components by casting it to xs:date
or xs:time
. Additionally, xs:date
values can be cast to xs:dateTime
, in which case the time components are filled in with zeros. Time zones are unchanged by the cast.
3.14.252.56