fn:dateTime function
The fn:dateTime function constructs an xs:dateTime value from an xs:date value and an xs:time value.
Syntax
- date-value
- An xs:date value.
- time-value
- An xs:time value.
Returned value
The returned value is an
xs:dateTime value with a date component that is equal to date-value and
a time component that is equal to time-value. The
time zone of the result is computed as follows:
- If neither argument has a time zone, the result has no time zone.
- If exactly one of the arguments has a time zone, or if both arguments have the same time zone, the result has this time zone.
- If the two arguments have different time zones, an error is returned.
Example
The following function returns an xs:dateTime value from an xs:date value and an xs:time value.
fn:dateTime((xs:date("2009-04-16")), (xs:time("12:30:59")))
The returned value is the xs:dateTime value 2009-04-16T12:30:59.