Adds $yearMonthDuration-var to the date specified by $date-var.
op:add-yearMonthDuration-to-date(xs:date $date-var, xf:yearMonthDuration $yearMonthDuration-var) —> xs:date
Returns the date result of adding the year and month specified by $yearMonthDuration-var to date specified by $date-var. The returned date value has the same timezone as $date-var. If $date-var has no timezone, then the returned date value has the no timezone.
The following example query adds a yearMonthDuration value equal to 1 year and 1 month to a date value equal to the date: January 1, 2003 as shown in the following query:
<date>{ op:add-yearMonthDuration-to-date(xs:date("2003-01-01"), xf:yearMonthDuration("P1Y1M")) }</date>
The resulting date value equal to the date: February 1, 2004 is returned as shown in the following result:
<date>2004-02-01</date>
W3C add-yearMonthDuration-to-date operator description.
W3C yearMonthDuration description.
xf:yearMonthDuration constructor description.
W3C date data type description
xs:date constructor description.