fn:timezone-from-date function
The fn:timezone-from-date function returns the time zone component of an xs:date value.
Syntax
- date-value
- The date value from which the time zone component is to be extracted.
date-value is of type xs:date, or is an empty sequence.
Returned value
If date-value is of type xs:date and has an explicit time zone component, the returned value is of type xs:dayTimeDuration, and the value is between -PT14H hours and PT14H, inclusive. The value is the deviation of the date-value time zone component from the UTC time zone.
If date-value does not have an explicit time zone component or is an empty sequence, the returned value is an empty sequence.
Example
The following function returns the time zone component of the date value for March 13, 2009 in the UTC-8 time zone.
fn:timezone-from-date(xs:date("2009-03-13-08:00"))
The returned value is -PT8H.