Hi,
I need to get the number of years between two dates, which I have managed in a roundabout way, but surely there is a more streamlined solution?
My code is:
Code:
years-from-duration(((current-date() - xsd:date(otherDate)) div xsd:dayTimeDuration('P1D')) div 365.242199 * xsd:yearMonthDuration('P1Y'))"
This works but relies on a division of 365.242199 days.
I appreciate XPath is not a programming language, so maybe this is the only way, but is there anything in place that would return the number of years more accurately?
Thanks in advance.