You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Roman Mario Xerxes Rometsch <xe...@mathematik.uni-ulm.de> on 2006/05/09 09:39:59 UTC

date formatting

Hi,
I need to reformat the date in <dcterms:created> (it's currently Tue May
09 08:16:02 CEST 2006 and I want to change it to something like Mon, 08
May 2006 11:32:36 +0100). Can someone tell me, where this string is
created?

Thanks

Mario Rometsch

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: date formatting

Posted by Tim Hannigan <ti...@queensu.ca>.
Hi Mario,

you can reformat it by using a i18n transformation.

Here's a sample code snippet that you'd use in an XSLT page2xhtml- 
(resourceType).xsl:

"
<xsl:variable name="dateCreated"><xsl:value-of select="//lenya:meta/ 
dcterms:created"/></xsl:variable>
<i18n:date-time src-pattern="EEE, d MMM yyyy HH:mm:ss z" pattern="dd- 
MM-yyyy HH:mm:ss z" value="{$dateCreated}"/> "


"

You'll notice that within the "<i18n:date-time" tag, there are "src- 
pattern" and "pattern" attributes. You can fiddle around with these  
to match whatever you prefer.

For more: http://cocoon.apache.org/2.1/userdocs/i18nTransformer.html

-Tim




On 9-May-06, at 3:39 AM, Roman Mario Xerxes Rometsch wrote:

> Hi,
> I need to reformat the date in <dcterms:created> (it's currently  
> Tue May
> 09 08:16:02 CEST 2006 and I want to change it to something like  
> Mon, 08
> May 2006 11:32:36 +0100). Can someone tell me, where this string is
> created?
>
> Thanks
>
> Mario Rometsch
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org