XSLT: Current date time long fromat with millisecond -
i have upgraded xslt processor. , getting current date time. not in desired format.
<xsl:value-of select="format-datetime(current-datetime(), '[y,4][d,2][m,2] [h]:[m]:[s]:[f01] [z]')" />
gives
20132409 14:03:17:54 -04:00
but want in long format milliseconds. 1346498794643
i hope i've remembered epoch correctly:
t:\ftemp>xslt2 milliseconds.xsl milliseconds.xsl <?xml version="1.0" encoding="utf-8"?>1380039731273 t:\ftemp>type milliseconds.xsl <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:xs="http://www.w3.org/2001/xmlschema" exclude-result-prefixes="xs" version="2.0"> <xsl:template match="/"> <xsl:value-of select="( current-datetime() - xs:datetime('1970-01-01t00:00:00') ) div xs:daytimeduration('pt1s') * 1000"/> </xsl:template> </xsl:stylesheet> t:\ftemp>
recall in xslt current date , time static value duration of transformation. same value every time invoke function in single invocation of given stylesheet.
Comments
Post a Comment