XML technologies / XSLT / XSLT and XPath functions / Alphabetical XSLT and XPath reference / timezone-from-dateTime

(Excerpt from “XSLT 2.0 & XPath 2.0” by Frank Bongers, chapter 5, translated from German)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

fn:timezone-from-dateTime

Category:

Value extraction from time values, date values and duration

Origin:

XPath 2.0

Return value:

The timezone component of a timestamp indication in the form of a duration value of xs:dayTimeDuration type.

Call/Arguments:

fn:timezone-from-dateTime($timestampValue)

$timestampValue:

Optional. A value of xs:dateTime type which corresponds to a date value with daytime indication whose timezone component shall be extracted.

Purpose of use:

The function extracts the value of the timezone offset of the UTC time of a timestamp value passed on in the form of a duration value of xs:dayTimeDuration type.

The outputted value may move in the interval between +14:00 (PT14H) and -14:00 hours (-PT14H). If the empty sequence is passed on, the function returns an empty result sequence.

Example - extracting the timezone from a timestamp value:

fn:timezone-from-dateTime(

xs:date("2003-07-30T13:20:00-05:00")

)

returns the value -05:00 in the form of -PT5H as xs:dayTimeDuration.

Function definition:

XPath 1.0:

The function is not available

XPath 2.0:

fn:timezone-from-dateTime($arg as xs:dateTime?) as xs:dayTimeDuration?

   

 

 

 

back to top