MarkLogic 12 EA 1 Product Documentation
fn.hoursFromTime

fn.hoursFromTime(
   arg as (Number|String)?
) as Number?

Summary

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 time whose hours component will be returned.

Example

fn.hoursFromTime(xs.time("11:23:00"))
=> 11

Example

fn.hoursFromTime(xs.time("21:23:00"))
=> 21

Example

fn.hoursFromTime(xs.time("01:23:00+05:00"))
=> 1

Example

fn.hoursFromTime(
    fn.adjustTimeToTimezone(
         xs.time("01:23:00+05:00"),
         xs.dayTimeDuration("PT0H")))
=> 20
Powered by MarkLogic Server | Terms of Use | Privacy Policy