functx:duration-from-timezone

Converts a timezone like “-05:00” or “Z” into xs:dayTimeDuration

Description

The functx:duration-from-timezone function accepts a timezone (as it appears in xs:date, xs:time, xs:dateTime etc. values) and converts it to an xs:dayTimeDuration value. The $timezone value can be Z, or in the format (+|-)HH:MM.

Parameters

Description

timezone:string()

the time zone, in (+|-)HH:MM format

Examples

XPath

Results

functx:duration-from-timezone(‘Z’)

PT0S

functx:duration-from-timezone(‘-05:00’)

-PT5H

functx:duration-from-timezone(‘+09:00’)

PT9H

See Also