XPath/XQuery time-equal function


Returns true if the two xs:time values represent the same instant in time, when treated as being times on the same date, before adjusting the timezone.

Operator Mapping

Defines the semantics of the "eq" operator when applied to two xs:time values. Also used in the definition of the "ne", "le" and "ge" operators.


$arg1 as xs:time,
$arg2 as xs:time
) as xs:boolean


This function is deterministic, context-dependent, and focus-independent. It depends on implicit-timezone.


Each of the supplied xs:time values is expanded to an xs:dateTime value by associating the time with an arbitrary date. The function returns the result of comparing these two xs:dateTime values using op:dateTime-equal.

The result of the function is thus the same as the value of the expression:

        fn:dateTime(xs:date('1972-12-31'), $arg1), 
        fn:dateTime(xs:date('1972-12-31'), $arg2))


Assume that the date components from the reference xs:dateTime correspond to 1972-12-31.

The expression op:time-equal(xs:time("08:00:00+09:00"), xs:time("17:00:00-06:00")) returns false().

The expression op:time-equal(xs:time("21:30:00+10:30"), xs:time("06:00:00-05:00")) returns true().

The expression op:time-equal(xs:time("24:00:00+01:00"), xs:time("00:00:00+01:00")) returns true().