June 2008
Intermediate to advanced
986 pages
27h 8m
English
[2.0]
implicit-timezone()
Returns the implicit timezone used when creating new
xs:date, xs:dateTime, and xs:time values.
xs:dayTimeDurationimplicit-timezone()
None.
An xs:dayTimeDuration
that contains the implicit timezone.
XQuery 1.0 and XPath 2.0 Functions and Operators section 16, “Context Functions.”
Here’s a stylesheet that retrieves the implicit timezone as
an xs:dayTimeDuration:
<?xml version="1.0"?> <!-- implicit-timezone.xsl --> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> <xsl:template match="/"> <xsl:text>
Using the implicit-timezone() function:

</xsl:text> <xsl:text> The implicit timezone for the current context is: </xsl:text> <xsl:value-of select="implicit-timezone()"/> </xsl:template> </xsl:stylesheet>
The stylesheet generates these results:
Using the implicit-timezone() function: The implicit timezone for the current context is: -PT5H
The results for Bangalore and London, respectively, look like this:
The implicit timezone for the current context is: PT5H30M ... The implicit timezone for the current context is: PT0S
Read now
Unlock full access