XPath/XQuery time-less-than function

Summary

Returns true if the first xs:time value represents an earlier instant in time than the second, when both are treated as being times on the same date, before adjusting the timezone.

Operator Mapping

Defines the semantics of the "lt" operator when applied to two xs:time values. Also used in the definition of the "ge" operator.

Signature

op:time-less-than(
$arg1 as xs:time,
$arg2 as xs:time
) as xs:boolean

Properties

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

Rules

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-less-than.

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

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

Examples

Assume that the dynamic context provides an implicit timezone value of -05:00.

The expression op:time-less-than(xs:time("12:00:00"), xs:time("23:00:00+06:00")) returns false().

The expression op:time-less-than(xs:time("11:00:00"), xs:time("17:00:00Z")) returns true().

The expression op:time-less-than(xs:time("23:59:59"), xs:time("24:00:00")) returns false().