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