Wednesday, August 1, 2012

Re: Working with Dates/Timezones

This is a classic problem. For starters, we (also operate in Germany :/ ) store just Dates where possible in Oracle and pull these out using java.sql.Date so there is no H/M/S information at all. We also use custom date serializers between Client/Server in GWT so that again, just the day is passed. We found that while there are many dates in our application, 95% of them don't need H:M:S, and further that the source date does not have TZ info, so we cannot even assume that the source H:M:S information is correct. Given this, all dates are stored UTC and the UI promulgates this fact.

This gets around the midnight issue for a 12:00:00 getting flipped to the next/previous date due to TZ.

However, in my personal applications (RunPartner.com) logged run time of day does matter. For this the user TZ is harvested from the browser, as well as if it is DST or not, all just using a hidden JS block. Then all values going in/out of the server are converted to/from the server TZ to the browser zone. I have not tested this however with historical DST changes like with Indiana changed their DST practices a few years ago.

I hope that helps.

Sincerely,
Joseph

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/_UF6Y9vcs5IJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment