I'm using XSLT 2.0, and am trying to calculate the in WS-Trust messages, where there're and elements, so I need to determine the number of days, fractionally, between two date/timestamps, e.g., between:
2014-06-28T03:00:12Z and 2014-06-26T13:00:02Z
I've tried using:
<xsl:sequence select="fn:days-from-duration(xs:dateTime('2014-06-26T13:00:02Z')-xs:dateTime('2014-06-27T13:00:02Z'))"/>
but the above just keeps giving me "-1", i.e., an integer.
If I could maybe get the hours or minutes duration, I might possibly calculate the fractional days, but I tried using:
<xsl:sequence select="fn:hours-from-duration(xs:dateTime('2014-06-26T13:00:02Z')-xs:dateTime('2014-06-27T13:00:02Z'))"/>
or:
<xsl:sequence select="fn:minutes-from-duration(xs:dateTime('2014-06-26T13:00:02Z')-xs:dateTime('2014-06-27T13:00:02Z'))"/>
and those both just give me "0".
Can anyone tell me how I can calculate the duration in either hours or minutes?
Thanks!