# op:duration-equal - XPath XQuery Reference

Returns true if $arg1 and $arg2 are durations of the same
            length.Defines the
         semantics of the "eq" operators when applied to two xs:duration values. Also
         used in the definition of the "ne" operator.If the xs:yearMonthDuration components of $arg1 and
               $arg2 are equal and the xs:dayTimeDuration components of
               $arg1 and $arg2 are equal, the function returns
               true.Otherwise, the function returns false.The semantics of this function are:
xs:yearMonthDuration($arg1) div xs:yearMonthDuration('P1M')  eq
xs:yearMonthDuration($arg2) div xs:yearMonthDuration('P1M')
    and
xs:dayTimeDuration($arg1) div xs:dayTimeDuration('PT1S')  eq
xs:dayTimeDuration($arg2) div xs:dayTimeDuration('PT1S')
that is, the function returns true if the months and seconds values of the
            two durations are equal.op:duration-equal(xs:duration("P1Y"),
                  xs:duration("P12M"))true()op:duration-equal(xs:duration("PT24H"),
                  xs:duration("P1D"))true()op:duration-equal(xs:duration("P1Y"),
                  xs:duration("P365D"))false()op:duration-equal(xs:yearMonthDuration("P0Y"),
                  xs:dayTimeDuration("P0D"))true()op:duration-equal(xs:yearMonthDuration("P1Y"),
                  xs:dayTimeDuration("P365D"))false()op:duration-equal(xs:yearMonthDuration("P2Y"),
                  xs:yearMonthDuration("P24M"))true()op:duration-equal(xs:dayTimeDuration("P10D"),
                  xs:dayTimeDuration("PT240H"))true()op:duration-equal(xs:duration("P2Y0M0DT0H0M0S"),
                  xs:yearMonthDuration("P24M"))true()op:duration-equal(xs:duration("P0Y0M10D"),
                  xs:dayTimeDuration("PT240H"))true()Note that this function, like any other, may be applied to arguments that are derived
            from the types given in the function signature, including the two subtypes
               xs:dayTimeDuration and xs:yearMonthDuration. With the
            exception of the zero-length duration, no instance of xs:dayTimeDuration
            can ever be equal to an instance of xs:yearMonthDuration.