xsl-list
[Top] [All Lists]

[xsl] current-dateTime() - no leading zero(s) before milliseconds

2008-06-04 07:54:55
hello,

XQuery is exactly current-dateTime()

for example please check Marklogic output -
2008-06-04T18:28:42.043246+04:00 (six digit, zero after dot present)

and also tried this in Saxon - several times

2008-06-04T18:31:51.8+04:00 (one digit, no leading zeros after dot - bad for me)
2008-06-04T18:32:22.545+04:00 (3 digit after dot - most common case - OK for me)
2008-06-04T18:33:02.49+04:00 (2 digits, no leading zero - bad for me)
2008-06-04T18:33:21.046+04:00 (wow - leading zero is present! - OK too)
2008-06-04T18:36:11.74+04:00 (2 digits, no leading zero - bad for me)
2008-06-04T18:39:03.09+04:00 (2 digits, one(!) leading zero - still bad for me)

well, in one xslt i calculate timestamp by <xsl:param name="timestamp"
        select="translate(substring(string(current-dateTime()), 1,
23), 'T:-.','')"/>

i need 3 digit from milliseconds with leading zeros

how can i avoid this strange effect?

With best wishes,
Slav

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--