fn:hours-from-time function

The fn:hours-from-time function returns the hours component of an xs:time value that is in its localized form.

Syntax

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

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

Returned value

If time-value is not an empty sequence, the returned value is of type xs:integer, and the value is in the range 0–23, inclusive. The value is the hours component of time-value.

If time-value is an empty sequence, the returned value is an empty sequence.

Example

The following function returns the hours component of the time value for 9:30 a.m. in the UTC-8 time zone.

fn:hours-from-time(xs:time("09:30:00-08:00"))

The returned value is 9.