# op:subtract-dateTimes - XPath XQuery Reference

Returns an xs:dayTimeDuration representing the amount of elapsed time
            between the instants arg2 and arg1.Defines the semantics of the "-"
         operator when applied to two xs:dateTime values.deterministiccontext-dependentfocus-independentIf either $arg1 or $arg2 do not contain an explicit timezone
            then, for the purpose of the operation, the implicit timezone provided by the dynamic
            context (See .) is
            assumed to be present as part of the value.The function returns the elapsed time between the date/time instant arg2
            and the date/time instant arg1, computed according to the algorithm given
            in Appendix E of , and expressed as a
               xs:dayTimeDuration.If the normalized value of $arg1 precedes in time the normalized value of
               $arg2, then the returned value is a negative duration.Assume that the dynamic context provides an implicit timezone value of
                  -05:00.op:subtract-dateTimes(xs:dateTime("2000-10-30T06:12:00"),
                  xs:dateTime("1999-11-28T09:00:00Z"))xs:dayTimeDuration("P337DT2H12M")