XPath/XQuery subtract-dayTimeDurations function

Summary

Returns the result of subtracting one xs:dayTimeDuration from another.

Operator Mapping

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

Signature

op:subtract-dayTimeDurations(
$arg1 as xs:dayTimeDuration,
$arg2 as xs:dayTimeDuration
) as xs:dayTimeDuration

Rules

The function returns the result of subtracting the value of $arg2 from the value of $arg1. The result is the xs:dayTimeDuration whose length in seconds is equal to the length in seconds of $arg1 minus the length in seconds of $arg2.

For handling of overflow, see .

Examples

The expression op:subtract-dayTimeDurations(xs:dayTimeDuration("P2DT12H"), xs:dayTimeDuration("P1DT10H30M")) returns xs:dayTimeDuration('P1DT1H30M').

Notes

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