On 4 sep, 02:38, JohnnyGWT <[EMAIL PROTECTED]> wrote:
> We have an app where different adjustments etc are entered. All
> adjustments etc are based entirely on a single business date from a
> single database.
>
> So, no matter where (what Locale) the user (browser) is currently in,
> a Date that gets sent to our db should be an EST date, NOT a date
> based on another different timezone(ie from UK, Asia etc).
> As I understand it, the long value of a Date (when it is instantiated)
> will reflect the current Locale. This is not what we need.
>
> Any ideas on how to solve this one?
> One idea is we extend Date to create Date with a value that reflects a
> true US value - adding an offset regardless of the Locale where its
> created. ie: UK date + offset, JP + offset...

How about turning the date to UTC before sending it on the wire?

   d.setTime(d.getTime() + (d.getTimezoneOffset() * 60000));

(don't know if you have to add or subscract the offset... it's a shame
that Java Date has no equivalent to JS Date's getUTCTime/setUTCTime)


> We don't have Calendar in GWT, we only have Date, so we can't use the
> lovely methods in Calendar.

AFAIK, there's somewhere a Calendar implementation which works in GWT;
you might find it in this groups' archives...

> Anyone else have similar problems with their GWT applications? How did
> you solve them?

Our users are expected to be in the same timezone as the server ;-)


--~--~---------~--~----~------------~-------~--~----~
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