You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Tomas Studva <ts...@gmail.com> on 2009/08/12 13:01:23 UTC

EXSLT format-date

Hi,
I want to format date with an exslt "format-date" XPath function. When I
call this:

<xsl:variable name="datePattern">dd.MM.yyyy. 'o' HH:mm</xsl:variable>
<xsl:value-of select="date:format-date('2009-08-12T12:51:51.625+02:00',
$datePattern)" />

the output is "12.08.2009. o 00:00".

Please can you explain why the printed time is 00:00? I want to print the
time not 00:00. Am I missing something?

Tomas Studva



-- 
View this message in context: http://www.nabble.com/EXSLT-format-date-tp24934159p24934159.html
Sent from the Xalan - J - Users mailing list archive at Nabble.com.


Re: EXSLT format-date

Posted by Tomas Studva <ts...@gmail.com>.
Thanks, it helped me. But I am disappointed with such behaviour, because i
have xml with such dates. I am using castor for java objects to xml
marshalling, and would expect that such tools are done to be used out of
box. I think it is correct that castor outputs miliseconds (because of
generality), bad is that exslt is not prepared for it. 
I am going to switch to date formatting in Java. How bad.

Thankfully Tomas Studva
 

Christoffer Dam Bruun wrote:
> 
> Hi Tomas,
> 
> If I remove the ".625" part of the date then I get the correct result.
> 
> On http://exslt.org/date/functions/format-date/index.html it shows that 
> the ".millis" are not
> one of the permitted formats.
> 
> Best regards
> Christoffer Bruun
> 
> On 12-08-2009 13:01, Tomas Studva wrote:
>> <xsl:variable name="datePattern">dd.MM.yyyy. 'o' HH:mm</xsl:variable>
>> <xsl:value-of select="date:format-date('2009-08-12T12:51:51.625+02:00',
>> $datePattern)" />
>>    
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/EXSLT-format-date-tp24934159p24937902.html
Sent from the Xalan - J - Users mailing list archive at Nabble.com.


Re: EXSLT format-date

Posted by Christoffer Dam Bruun <cd...@flyingpigs.dk>.
Hi Tomas,

If I remove the ".625" part of the date then I get the correct result.

On http://exslt.org/date/functions/format-date/index.html it shows that 
the ".millis" are not
one of the permitted formats.

Best regards
Christoffer Bruun

On 12-08-2009 13:01, Tomas Studva wrote:
> <xsl:variable name="datePattern">dd.MM.yyyy. 'o' HH:mm</xsl:variable>
> <xsl:value-of select="date:format-date('2009-08-12T12:51:51.625+02:00',
> $datePattern)" />
>