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