dateTime function

The fn:dateTime function constructs an xs:dateTime value from an xs:date value and an xs:time value.

Syntax

Read syntax diagramSkip visual syntax diagramfn:dateTime( date-value, time-value)
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 timezone of the result is computed as follows:
  • If neither argument has a timezone, the result has no timezone.
  • If exactly one of the arguments has a timezone, or if both arguments have the same timezone, the result has this timezone.
  • If the two arguments have different timezones, 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("2005-04-16")), (xs:time("12:30:59")))

The returned value is the xs:dateTime value 2005-04-16T12:30:59.