XPath/XQuery add-yearMonthDuration-to-dateTime function

Summary

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

Operator Mapping

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

Signature

op:add-yearMonthDuration-to-dateTime(
$arg1 as xs:dateTime,
$arg2 as xs:yearMonthDuration
) as xs:dateTime

Properties

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

Rules

The function returns the result of adding $arg2 to the value of $arg1 using the algorithm described in Appendix E of , disregarding the rule about leap seconds. If $arg2 is negative, then the result xs:dateTime precedes $arg1.

The result has the same timezone as $arg1. If $arg1 has no timezone, the result has no timezone.

Examples

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