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

Subject: Re: [xsl] current-dateTime() - no leading zero(s) before milliseconds
From: "Colin Adams" <colinpauladams@xxxxxxxxxxxxxx>
Date: Wed, 4 Jun 2008 15:57:59 +0100
Don't use striing().
Use format-dateTime() (or however it is spelt).

2008/6/4 Vyacheslav Sedov <vyacheslav.sedov@xxxxxxxxx>:
> 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

Current Thread