timezone-from-dateTime function
The fn:timezone-from-dateTime function returns the time zone component of an xs:dateTime value.
Syntax
- dateTime-value
- The dateTime value from which the timezone component is to be
extracted.
dateTime-value is of type xs:dateTime, or is an empty sequence.
Returned value
If dateTime-value is of type xs:dateTime and has an explicit timezone component, the returned value is of type xdt:dayTimeDuration, and the value is between -PT14H and PT14H, inclusive. The value is the deviation of the dateTime-value timezone component from the UTC time zone.
If dateTime-value does not have an explicit timezone component, or is an empty sequence, the returned value is an empty sequence.
Examples
The following function returns the timezone component of the dateTime value for October 30, 2005 at 7:30 am in the UTC-8 time zone.
fn:timezone-from-dateTime(xs:dateTime("2005-10-30T07:30:00-08:00"))The returned value is -PT8H.
The following function returns the timezone component of the dateTime value for January 1, 2005 at 2:30 pm in the UTC+10:30 time zone.
fn:timezone-from-dateTime(xs:dateTime("2005-01-01T14:30:00+10:30"))The returned value is PT10H30M.
