It's actually a bug in the javascript.   I think the double/long
storing the date in the browser loses precision in certain cases and
when it gets sent to the server the day is getting adjusted
accordingly.

http://code.google.com/p/google-web-toolkit/issues/detail?id=3276


On Apr 22, 2:13 pm, Pascal <zig...@gmail.com> wrote:
> This is probably happening because thetimezonerules are different
> between java and the brower. When you send a date, you're sending a
> millisecond offset. Also, if the browser is in a differenttimezone
> than the server, you can be a day off your dates if the (hidden) time
> is close to midnight.
>
> My advice would be, if you need a date object that has no time
> component, create a simple dto or use a string, this way, you're sure
> it will be the same date regardless of timezones.
>
> Pascal
>
> On Apr 22, 10:44 am, Stephan <stephanwes...@gmail.com> wrote:
>
> > I've run into quite a strange issue serializing dates from the browser
> > to the server.
>
> > When I enter the following dates in the browser I receive for some
> > dates the wrong value at the server side (using date pattern dd-MM-
> > yyyy):
>
> > 1-1-1968   ->  Mon Jan 01 00:00:00 CET 1968   - correct
> > 1-3-1968   ->  Fri Mar 01 00:00:00 CET 1968     - correct
> > 1-4-1968   ->  Sun Mar 31 23:00:00 CET 1968   - wrong
> > 4-4-1968   ->  Wed Apr 03 23:00:00 CET 1968   - wrong
> > 1-4-1999   ->  Thu Apr 01 00:00:00 CEST 1999  - correct
>
> > Note that in April 1968 there is a 1 day difference. This problem does
> > not occur in hosted mode, only in web mode.
>
> > Perhaps i've messed up somehow, perhaps someone else can try as well.
>
> > thanks,
>
> > Stephan
--~--~---------~--~----~------------~-------~--~----~
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