MarkLogic 10 Product Documentation
fn:hours-from-dateTime

fn:hours-from-dateTime(
   $arg as xs:dateTime?
) as xs:integer?

Summary

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.

Example

fn:hours-from-dateTime(
    xs:dateTime("1999-05-31T08:20:00-05:00"))
=> 8

Example

fn:hours-from-dateTime(
    xs:dateTime("1999-12-31T21:20:00-05:00"))
=> 21

Example

fn:hours-from-dateTime(
  fn:adjust-dateTime-to-timezone(
    xs:dateTime("1999-12-31T21:20:00-05:00"),
    xs:dayTimeDuration("PT0H"))) 
=> 2

Example

fn:hours-from-dateTime(
    xs:dateTime("1999-12-31T12:00:00"))
=> 12
Powered by MarkLogic Server | Terms of Use | Privacy Policy