The following function returns P4511D: 0 but I expect P4511D: 12Bug or bad usage?
let $d1 := xs:date('2007-07-31')
let $d2 := xs:date('2019-12-06')
let $duration := $d2 - $d1
let $years := years-from-duration($duration)
return $duration || ': ' || $years
The spec https://www.w3.org/TR/xpath-functions/#func-years-from-duration
says "If $arg
is
an xs:dayTimeDuration
the function returns
0.".