Project

Profile

Help

saxon:timestamp() timezone

Added by T Hata over 6 years ago

Code:


<xsl:stylesheet exclude-result-prefixes="#all" version="2.0" xmlns:saxon="http://saxon.sf.net/"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:template name="main">
<xsl:value-of select="implicit-timezone(), current-dateTime(), saxon:timestamp()" separator="
" />
</xsl:template>
</xsl:stylesheet>
Output:
Saxon-EE 9.8.0.4J from Saxonica
Java version 1.8.0_144
...
PT9H
2017-10-02T17:43:38.536+09:00
2017-10-02T08:43:38.536+09:00

Is it working as expected? I thought in this case @saxon:timestamp()@ would return the (virtually) same value as @current-dateTime()@.


Replies (2)

RE: saxon:timestamp() timezone - Added by Michael Kay over 6 years ago

Actually it seems to be working correctly on JDK 6 but not on JDK 8. There's a different code path for saxon:timestamp() on JDK 8 to take advantage of java.time.Instant, and this path appears to be getting the timezone calculation wrong.

    (1-2/2)

    Please register to reply