You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Adrian Crum <ad...@hlmksw.com> on 2008/06/05 01:48:43 UTC

Freemarker Timestamp rendering - Developers Take Note

I just noticed in a Freemarker template file something like:

${someTimestamp.toString()}

There is a problem with that. Freemarker will call the Timestamp 
object's toString() method - which will output the date and time in the 
server's time zone and locale, NOT the user's.

It is better to eliminate the toString method call, like so:

${someTimestamp}

-Adrian

Re: Freemarker Timestamp rendering - Developers Take Note

Posted by Ashish Vijaywargiya <vi...@gmail.com>.
+1.

On Wed, Jun 4, 2008 at 7:48 PM, Adrian Crum <ad...@hlmksw.com> wrote:

> I just noticed in a Freemarker template file something like:
>
> ${someTimestamp.toString()}
>
> There is a problem with that. Freemarker will call the Timestamp object's
> toString() method - which will output the date and time in the server's time
> zone and locale, NOT the user's.
>
> It is better to eliminate the toString method call, like so:
>
> ${someTimestamp}
>
> -Adrian
>