XPath/XQuery add-dayTimeDuration-to-date function

Summary

Returns the xs:date that is a given duration after a specified xs:date (or before, if the duration is negative).

Operator Mapping

Defines the semantics of the "+" operator when applied to an xs:date and an xs:dayTimeDuration value.

Signature

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

Properties

This function is deterministic, context-independent, and focus-independent.

Rules

The function returns the result of casting $arg1 to an xs:dateTime, adding $arg2 using the function op:add-dayTimeDuration-to-dateTime, and casting the result back to an xs:date.

Examples

The expression op:add-dayTimeDuration-to-date(xs:date("2004-10-30Z"), xs:dayTimeDuration("P2DT2H30M0S")) returns xs:date("2004-11-01Z").