You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Lewis <ch...@bellsouth.net> on 2008/01/04 10:25:51 UTC
Re: [T5] How to format java.lang.Date when using expansion
As you can see, there's a lot of options, and on that note I'll add one
more. You can use the DateFormat component, which is part of this
component library: http://code.google.com/p/gc-tapestry-components/.
It has the disadvantage of providing a specific function, as opposed to
Output/OutputLocaleNumber which handle various situations. This
limitation, on the other hand, makes it easier to use:
<div t:type="gc/dateformat" date="article.created" format="dd MMMM yyyy"/>
Just pass it a date (article.created is a page property) and a date
format as supported by java's SimpleDateFormat, and that's all.
chris
Dapeng wrote:
> hi guys
>
> i am using expansion to output a Date object like
>
>
> Your last login: ${lastLoginDate}
>
>
>
> but how to format it ?? currently it gives the whole string as Wed Dec
> 12 18:36:38 SGT 2007
>
> how to change it to like dd/mm/yyyy???
>
>
>
>
>
>
>
>
>
>
>
> regards
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org