XPath/XQuery add-dayTimeDurations function

Summary

Returns the sum of two xs:dayTimeDuration values.

Operator Mapping

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

Signature

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

Rules

The function returns the result of adding the value of $arg1 to the value of $arg2. The result is the xs:dayTimeDuration whose length in seconds is equal to the sum of the length in seconds of the two input durations.

For handling of overflow, see .

Examples

The expression op:add-dayTimeDurations(xs:dayTimeDuration("P2DT12H5M"), xs:dayTimeDuration("P5DT12H")) returns xs:dayTimeDuration('P8DT5M').

Notes

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