Loading TOC...

MarkLogic Server 11.0 Product Documentation
fn:hours-from-duration

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

Summary

Returns an xs:integer representing the hours component in the canonical lexical representation of the value of $arg. The result may be negative.

If $arg is the empty sequence, returns the empty sequence.

Parameters
arg The duration whose hour component will be returned.

Example

fn:hours-from-duration(xs:duration("P3DT10H"))
=> 10

Example

fn:hours-from-duration(xs:duration("P3DT12H32M12S"))
=> 12

Example

fn:hours-from-duration(xs:duration("PT123H"))
=> 3

Example

fn:hours-from-duration(xs:duration("-P3DT10H"))
=> -10

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.