XPath/XQuery subtract-dayTimeDuration-from-date function

Summary

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

Operator Mapping

Defines the semantics of the "-" operator when applied to an xs:date and an xs:dayTimeDuration.

Signature

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

Properties

This function is deterministic, context-independent, and focus-independent.

Rules

Returns the xs:date computed by negating $arg2 and adding the result to $arg1 using the function op:add-dayTimeDuration-to-date.

Examples

The expression op:subtract-dayTimeDuration-from-date(xs:date("2000-10-30"), xs:dayTimeDuration("P3DT1H15M")) returns xs:date("2000-10-26").