Returns the ratio of two xs:dayTimeDuration
values, as a decimal
number.
xs:dayTimeDuration
values.op:divide-dayTimeDuration-by-dayTimeDuration
( $arg1
as xs:dayTimeDuration
,$arg2
as xs:dayTimeDuration
xs:decimal
The function returns the result of dividing the value of $arg1
by
$arg2
. The result is the xs:dayTimeDuration
whose length in
seconds is equal to the length in seconds of $arg1
divided by the length in
seconds of $arg2
. The calculation is performed by applying
op:numeric-divide
to the two xs:decimal
operands.
For handling of overflow and underflow, see .
The expression fn:round-half-to-even( op:divide-dayTimeDuration-by-dayTimeDuration(
xs:dayTimeDuration("P2DT53M11S"), xs:dayTimeDuration("P1DT10H")),
4)
returns 1.4378
.
This examples shows how to determine the number of seconds in a duration.
The expression op:divide-dayTimeDuration-by-dayTimeDuration(xs:dayTimeDuration("P2DT53M11S"),
xs:dayTimeDuration("PT1S"))
returns 175991.0
.
Either operand (and therefore the result) may be negative.