This entry covers four related functions: subtract-dates-yielding-yearMonthDuration() , subtract-dates-yielding-dayTimeDuration() , subtract-dateTimes-yielding-year MonthDuration() , and subtract-dateTimes-yielding-dayTimeDuration() . All three functions return the duration that separates one date or dateTime from another. If the first argument is chronologically earlier than the second argument, the result is a negative duration. For example, «subtract-dates-yielding-dayTimeDuration(xs:date('2004-06-01'), xs:date('2004-05-01')) » returns the duration P31D .
Argument | Data Type | Meaning |
---|---|---|
end-point | xs:date or xs:dateTime | The end point of an interval |
start-point | xs:date or xs:dateTime | The start point of the interval |
Result | xdt:dayTimeDuration or xdt:yearMonthDuration | The duration between the start point and the end point of the interval |