XPath/XQuery divide-dayTimeDuration function


Returns the result of multiplying a xs:dayTimeDuration by a number.

Operator Mapping

Defines the semantics of the "div" operator when applied to two xs:dayTimeDuration values.


$arg1 as xs:dayTimeDuration,
$arg2 as xs:double
) as xs:dayTimeDuration


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 numeric value $arg2.

If $arg2 is positive or negative infinity, the result is a zero-length duration. If $arg2 is positive or negative zero, the result overflows and is handled as described in .

For handling of overflow and underflow, see .


The expression op:divide-dayTimeDuration(xs:dayTimeDuration("P1DT2H30M10.5S"), 1.5) returns xs:duration("PT17H40M7S").

Error Conditions

A dynamic error is raised if $arg2 is NaN.


Either operand (and therefore the result) may be negative.