I have two dates I am trying to subtract and get a xs:yearMonthDuration.
In "0.9-ml" there is a function you can call but in "1.0-ml" the
documentation says to subtract the dates. But how do I specify that I want
a xs:yearMonthDuration instead of a xs:dayTimeDuration.
MarkLogic Version: 7.0-2.3
Thanks,
-Will
xquery version "1.0-ml";
let $date1 := xs:dateTime(xs:date("2015-03-27"))
let $date2 := xs:dateTime(xs:date("2024-03-27"))
let $test := $date1 - $date2
return $test
***************
xs:dayTimeDuration("-P3288D")
xquery version "0.9-ml"
let $date1 := xs:dateTime(xs:date("2015-03-27"))
let $date2 := xs:dateTime(xs:date("2024-03-27"))
let $test := fn:subtract-dateTimes-yielding-yearMonthDuration($date1,
$date2)
return $test
**************
xs:yearMonthDuration("-P8Y11M")
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general