functx:timezone-from-duration
Converts an xs:dayTimeDuration into a timezone like “-05:00” or “Z”
Description
The functx:timezone-from-duration function accepts an xs:dayTimeDuration and converts it to a timezone value (formatted as it appears in xs:date, xs:time, xs:dateTime etc. values). The dayTimeDuration may only have the hours (H) component (or the seconds component if the value is PT0S) and must be between -PT14H and PT14H inclusive.
Parameters |
Description |
---|---|
duration:string() |
the duration |
Examples
XPath |
Results |
---|---|
functx:timezone-from-duration(xs:dayTimeDuration(‘PT0S’)) |
Z |
functx:timezone-from-duration(xs:dayTimeDuration(‘-PT5H’)) |
-05:00 |
functx:timezone-from-duration(xs:dayTimeDuration(‘PT9H’)) |
+09:00 |