
sql:hours( $arg as xs:genericDateTimeArg? ) as xs:integer?
Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.
| Parameters | |
|---|---|
| arg | The genericDateTime whose hours component will be returned. |
sql:hours(xs:time("11:23:00"))
=> 11
sql:hours(xs:time("21:23:00"))
=> 21
sql:hours(xs:time("01:23:00+05:00"))
=> 1
sql:hours(
fn:adjust-time-to-timezone(
xs:time("01:23:00+05:00"),
xs:dayTimeDuration("PT0H")))
=> 20
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.