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