Actually what probably happens is that the date you send has the time
part set to midnight, and somehow the date you get is translated with
a negative offset to something like 23:00 the previous day, so that
when you extract the date-only part is appears to be the previous
day.

The solution is simple: if you don't need the time part, don't use the
Date type on the client, or you will get into this problem (and
others...). You will spare yourself a lot of headaches if you use a
custom class with (day-month-year) and leave all date calculations on
the server.

I recently came across this issue and it caused me some serious head-
banging, so I wrote a little article about it to warn others:
http://blog.gerardin.info/archives/674

Good luck :)
Olivier



On Mar 1, 1:55 pm, Zé Vicente <[email protected]> wrote:
> Hello all,
>
> I am having a very bad time with Dates on  my GWT application. Can you
> please help me?
>
> The scenario:
> 1. The client is on TimeZone A
> 2. Server is on TimeZone B
>
> When the user provides a date on my application, I send the date to
> the server using RPC. Then, on the server side, the date is serialized
> by with ONE DAY LESS.
>
> Ex: The user types 21-may-2010. Then on the server, I get 20-may-2010.
>
> This is not happening to all users. Just the ones with different
> timezones from the server.
>
> How can I fix this?
>
> Thank you!
> José Vicente

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to