fn: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 time zone 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 time zone component, the returned value is of type xs:dayTimeDuration, and the value is between -PT14H and PT14H, inclusive. The value is the deviation of the dateTime-value time zone component from the UTC time zone.
If dateTime-value does not have an explicit time zone component, or is an empty sequence, the returned value is an empty sequence.
Examples
The following function returns the time zone component of the dateTime value for October 30, 2009 at 7:30 a.m. in the UTC-8 time zone.
fn:timezone-from-dateTime(xs:dateTime("2009-10-30T07:30:00-08:00"))
The returned value is -PT8H.
The following function returns the time zone component of the dateTime value for January 1, 2009 at 2:30 p.m. in the UTC+10:30 time zone.
fn:timezone-from-dateTime(xs:dateTime("2009-01-01T14:30:00+10:30"))
The returned value is PT10H30M.