fn:timezone-from-time function

The fn:timezone-from-time function returns the time zone component of an xs:time value.

Syntax

Read syntax diagramSkip visual syntax diagramfn:timezone-from-time( time-value)
time-value
The time value from which the time zone component is to be extracted.

time-value is of type xs:time, or is an empty sequence.

Returned value

If time-value is of type xs:time 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 time-value time zone component from UTC time zone.

If time-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 time value for 12 noon in the UTC-5 time zone.

fn:timezone-from-time(xs:time("12:00:00-05:00"))

The returned value is -PT5H.

In the following function, the time value for 1:00 p.m. does not have a time zone component.

fn:timezone-from-time(xs:time("13:00:00"))

The returned value is the empty sequence.