XPath/XQuery add-yearMonthDuration-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:yearMonthDuration value.

Signature

op:add-yearMonthDuration-to-date(
$arg1 as xs:date,
$arg2 as xs:yearMonthDuration
) 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-yearMonthDuration-to-dateTime, and casting the result back to an xs:date.

Examples

The expression op:add-yearMonthDuration-to-date(xs:date("2000-10-30"), xs:yearMonthDuration("P1Y2M")) returns xs:date("2001-12-30").