hours-from-dateTime function

The fn:hours-from-dateTime function returns the hours component of an xs:dateTime value.

Syntax

Read syntax diagramSkip visual syntax diagramfn:hours-from-dateTime( dateTime-value)
dateTime-value
The dateTime value from which the hours 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, the returned value is of type xs:integer, and the value is between 0 and 23, inclusive. The value is the hours component of dateTime-value.

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

Example

The following function returns the hours component of the dateTime value for January 31, 2005 at 2:00 pm in the UTC-8 time zone.

fn:hours-from-dateTime(xs:dateTime("2005-01-31T14:00:00-08:00"))

The returned value is 14.