XPath/XQuery subtract-dayTimeDuration-from-dateTime function

Summary

Returns the xs:dateTime that is a given duration before a specified xs:dateTime (or after, if the duration is negative).

Operator Mapping

Defines the semantics of the "-" operator when applied to an xs:dateTime an and xs:dayTimeDuration values

Signature

op:subtract-dayTimeDuration-from-dateTime(
$arg1 as xs:dateTime,
$arg2 as xs:dayTimeDuration
) as xs:dateTime

Rules

The function returns the xs:dateTime computed by negating $arg2 and adding the result to the value of $arg1 using the function op:add-dayTimeDuration-to-dateTime.

Examples

The expression op:subtract-dayTimeDuration-from-dateTime(xs:dateTime("2000-10-30T11:12:00"), xs:dayTimeDuration("P3DT1H15M")) returns xs:dateTime("2000-10-27T09:57:00").