Re: current timestamp in XSLT 1.0

Michael Kay <[email protected]> Fri, 27 Apr 2012 08:12:29 +0100
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
If you're using Xalan and Java, then there's very little reason not to 
move to Saxon and enjoy all the wonders of XSLT 2.0, including a vast 
array of date and time functions.

Michael Kay
Saxonica

On 27/04/2012 00:58, helix84 wrote:
> Thanks for your answer, Hermann. Thanks for pointing out that
> date:seconds() without arguments returns unix timestamp, I overlooked
> that. Your script for testing XPath expressions also seems generally
> useful.
>
> However, my XSLT processor seems to be Xalan 2.7.0 and it only
> supports EXSLT core functions, i.e. not date:seconds(). OTOH, I found
> out I can call Java functions easily, so this seems to be the simplest
> solution in my case:
>
> <xsl:template
>      name="test"
>      xmlns:java="http://xml.apache.org/xslt/java"
>      <xsl:value-of
> select="round(java:java.lang.System.currentTimeMillis() div 1000)"/>
> </xsl:template>
>
> Regards,
> ~~helix84
> _______________________________________________
> exslt mailing list
> [email protected]
> http://www.exslt.org/list
>