XPath/XQuery add-dayTimeDuration-to-dateTime function

Summary

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

Operator Mapping

Defines the semantics of the "+" operator when applied to an xs:dateTime and an xs:dayTimeDuration value.

Signature

op:add-dayTimeDuration-to-dateTime(
$arg1 as xs:dateTime,
$arg2 as xs:dayTimeDuration
) as xs:dateTime

Properties

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

Rules

The function returns the result of adding $arg2 to the value of $arg1 using the algorithm described in Appendix E of , disregarding the rule about leap seconds. If $arg2 is negative, then the result xs:dateTime precedes $arg1.

The result has the same timezone as $arg1. If $arg1 has no timezone, the result has no timezone.

Examples

The expression op:add-dayTimeDuration-to-dateTime(xs:dateTime("2000-10-30T11:12:00"), xs:dayTimeDuration("P3DT1H15M")) returns xs:dateTime("2000-11-02T12:27:00").