Subtracts the time duration specified by $dayTimeDuration-var from the date specified by $date-var.
op:subtract-dayTimeDuration-from-date(xs:date $date-var, xf:dayTimeDuration $dayTimeDuration-var) —> xs:date
Contains a time duration that can contain days, hours, minutes, and seconds. |
Returns the date value of subtracting the time duration specified by $dayTimeDuration-var from the date specified by $date-var.
The following example query subtracts a positive dayTimeDuration value equal to 1 day and 1 minute from a date value equal to the date: January 2, 2003 as shown in the following query:
<positive>{ op:subtract-dayTimeDuration-from-date(xs:date("2003-01-02"), xf:dayTimeDuration("P1DT1M")) }</positive>
The resulting date value equal to the date: January 1, 2003 is returned as shown in the following result:
<positive>2003-01-01</positive>
The following example query subtracts a negative dayTimeDuration value equal to 1 day and 1 minute from a date value equal to the date: January 2, 2003 as shown in the following query:
<negative>{ op:subtract-dayTimeDuration-from-date(xs:date("2003-01-02"), xf:dayTimeDuration("-P1DT1M")) }</negative>
The resulting date value equal to the date: January 3, 2003 is returned as shown in the following result:
<negative>2003-01-03</negative>
W3C subtract-dayTimeDuration-from-date operator description.
W3C dayTimeDuration description.
xf:dayTimeDuration constructor description.
W3C date data type description
xs:date constructor description.