It's a bit unclear, the problem with a day is because the difference
of 4 hours?

One way to manage dates, when all the users are in the same timezone,
is to manage it as a String (yyyymmdd for example). It's very clear
for all developpers in the project (specially for junior ones).

The best way is to use UTC (standard time) + Date objects + timezones.
In this way you will not have any problem with timezones, daysavings
time, etc.
But all the users must have well configured it's timezone.
And dates should always be used in Java and stored in the server as
Dates, timestamps or an apropiate object.
For some people it's difficult to work in this way because each time
they debug or review some information
the hour depends on the configured timezone. For example you can see
one hour in the logs, another different in TOAD and another different
in a TOAD in other PC, but all could be the same. It's translated to
string using the local configuration of the PC your were working.


On Mar 31, 1:41 am, Superman859 <russ.d.hollo...@gmail.com> wrote:
> I have an java.util.Date object that is passed using GWT-RPC from the
> server to the client.  It is pulled from a MySQL database as some date
> at 12h 00m 00s (12:00 AM).  However, when it arrives to the client,
> the time is 8:00 PM the day before (4 hours earlier).  I assume this
> is because my timezone is EST and I believe we are offset 4 hours from
> UTC.
>
> I'm not sure what the best way to handle this is.  I'm developing an
> application that a client will install, and I'm not sure on their
> server configurations / their client machines are configured.
>
> What would be the easiest way for the times to match up?  Do I have to
> assume they have a specific time zone set?
>
> The problem isn't so much in the hours matching, but in the days.
> Currently, March 27 on the server turns into March 26 on the client,
> so all statistics have everything one day previous.  I could simply
> set the time from 12:00AM to 12:00PM, as this would probably avoid the
> issue since the offset should be less than 12 hours, but is there a
> better solution?
>
> When they create a date client side, it gets sent to the server and
> saved into a MySQL database.  Currently, they create March 27, it goes
> to the server as March 27, saves in database as March 27, pulls from
> db as March 27, but when it arrives back at the client again it is now
> March 26.
--~--~---------~--~----~------------~-------~--~----~
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