Thanks Pascal...

The application I implemented is to follow command made by our
client... and it's needed to display all the information of the date
(timestamp format) saved on database ...

We have some people working in Maroc and it's them that encountered
'the problem' ... I thought that to force the locale of the
application in the .gwt.xml and in the jsp page with the meta line,
will resolve the problem... it seems that its the case on my
computer.. but not when i deploy the application !

Not easy to manipulate date in informatic !

JP

On Feb 12, 8:54 pm, Pascal <zig...@gmail.com> wrote:
> Bonjour JP,
> The problem is not with the DateTimeFormat class. You have to look at
> the way dates work in java. A date object is little more than an
> offset in milliseconds which happens to be on a give day in the
> timezone where the date object has been created. So for example, if
> you create it with a calendar object with no time component or
> retrieve it from a database date object, it will be at midnight on a
> given day. Now, if you send it to the client which is in a time zone
> that's behind the server's timezone, it will fall on the previous day.
>
> The way we solved this was to create our own DateDTO  for dealing with
> dates with no time component. It only captured year, month and day.
> Then we do a conversion to Date on the client for rendering.
>
> Note that in another context, the timezone behavior is prettty useful.
> If you create a date object on the server that represents 11am, you
> send it to the client, which is 2 hours behind, and you render it, you
> will see that it now displays 9am which is what the server time is in
> local time.
>
> Hope this helps,
>
> Pascal
>
> On Feb 12, 10:44 am, jptard <jpt...@gmail.com> wrote:
>
> > Hello,
>
> > I encounter a problem with DateTimeFormat class..., not on my computer
> > but when my application is deployed on production:
>
> > I configured my module to force locale fr_FR like this on my module
> > properties file:
>
> >       <extend-property name="locale" values="fr_FR"/>
>
> > and I put the meta line below on my jsp page:
>
> >      <meta name="gwt:property" content="locale=fr_FR"/>
>
> > When I am on my computer with a tomcat server, i can change my
> > timezone of my computer and my date displayed on the module is the
> > same each time....
>
> > When we deployed the application on an unix server, if I change the
> > timezone of my computer, the date displayed on my module can change :
> > 20/03/2009 instead of 21/03/2009 for example...
>
> > I can't understand why.. and spend my day to resolve the problem.. but
> > with no success...
>
> > If anyone has encountered a similar problem and can help me... Thanks
> > in advance,
>
> > JP
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to