Returns the xs:dayTimeDuration that corresponds to the elapsed time between
the values of $arg2 and $arg1 treated as times on the same
date.
xs:time values.op:subtract-times( $arg1 as xs:time,$arg2 as xs:timexs:dayTimeDurationThe function returns the result of the expression:
op-subtract-dateTimes(
fn:dateTime(xs:date('1972-12-31'), $arg1),
fn:dateTime(xs:date('1972-12-31'), $arg2))Assume that the dynamic context provides an implicit timezone value of
-05:00. Assume, also, that the date components of the reference
xs:dateTime correspond to "1972-12-31".
The expression op:subtract-times(xs:time("11:12:00Z"),
xs:time("04:00:00")) returns xs:dayTimeDuration("PT2H12M").
The expression op:subtract-times(xs:time("11:00:00-05:00"),
xs:time("21:30:00+05:30")) returns xs:dayTimeDuration("PT0S").
The expression op:subtract-times(xs:time("17:00:00-06:00"),
xs:time("08:00:00+09:00")) returns xs:dayTimeDuration("P1D").
The expression op:subtract-times(xs:time("24:00:00"),
xs:time("23:59:59")) returns xs:dayTimeDuration("-PT23H59M59S").
Any other reference date would work equally well.