Adds $dayTimeDuration-var to the date and time specified by $dateTime-var.
op:add-dayTimeDuration-to-dateTime(xs:dateTime $dateTime-var, xf:dayTimeDuration $dayTimeDuration-var) —> xs:dateTime
Contains a time duration that can contain days, hours, minutes, and seconds. |
Returns the dateTime result of adding the date and time specified by $dayTimeDuration-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 dayTimeDuration value equal to 1 day, 2 hours, 30 minutes, and 5 seconds 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-dayTimeDuration-to-dateTime(xs:dateTime("2003-01-01T01:00:00"), xf:dayTimeDuration("P1DT2H30M5S")) }</dateTime>
The resulting dateTime value equal to the date: January 2, 2003 and the time: 3:30:05 AM is returned as shown in the following result:
<dateTime>2003-01-02T03:30:05</dateTime>
W3C add-dayTimeDuration-to-dateTime operator description.
W3C dayTimeDuration description.
xf:dayTimeDuration constructor description.
W3C dateTime data type description
xs:dateTime constructor description.