format-dateTime() conventional timezone name
Posted: Mon Feb 23, 2009 5:02 pm
I'm trying to get the timezone name using format-dateTime(), following an adjust-dateTime-to-timezone(), in Saxon 9 (whatever version ships with oXygen 10).
with Saxon 8.7 I could do :
declaring xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes"
The [ZN,*-3] bit would output est.
With Saxon 9 :
declaring xmlns:xs="http://www.w3.org/2001/XMLSchema"
The [ZN,*-3] bit outputs -05:00.
with Saxon 8.7 I could do :
declaring xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes"
Code: Select all
<xsl:variable name="est-time" select="adjust-dateTime-to-timezone(current-dateTime(), xdt:dayTimeDuration('-PT5H'))"/>
<xsl:value-of selEST="format-dateTime($est-time, '[D] [MN,*-3] [Y] [h]:[m01][PN,*-2] [ZN,*-3]')"/>
With Saxon 9 :
declaring xmlns:xs="http://www.w3.org/2001/XMLSchema"
Code: Select all
<xsl:variable name="dateTime" select="current-dateTime()"/>
<xsl:variable name="est-zone" select="xs:dayTimeDuration('-PT5H')"/>
<xsl:variable name="est" select="adjust-dateTime-to-timezone($dateTime, $est-zone)"/>
<xsl:value-of select="format-dateTime($est, '[D] [MN,*-3] [Y] [h01]:[m01] [PN, *-2] [ZN,*-3]')"/>