Hi,

You can do something like this:
Write custom Date/Time serializers and put them in the root of your
project. Like this:

Project
| - your.package.com
| - com.google.gwt.user.client.rpc.core.java.sql
| - com.google.gwt.user.client.rpc.core.java.util

The custom serializers NEED to be named:

Date_CustomFieldSerializer.java
Timestamp_CustomFieldSerializer.java

When writing the serializers, import the right types (java.sql.Date,
java.util.Date, java.sql.Timestamp)

Sorry for my english.






On Aug 9, 7:23 am, Paul Robinson <ukcue...@gmail.com> wrote:
> You can't change the timezone. You can't even create a date on the
> client and tell it what timezone it should be in - Javascript does not
> provide a way to do this.
>
> If you want dates on the client to appear to be the same time of day and
> date as it is on the server, regardless of the client's timezone, and
> you are using GWT serialization, then you have two options:
> (1) Avoid Date objects in your DTOs, and use some encoding of your own
> instead
> (2) Modify GWT itself so that its custom serializers for java.util.Date,
> java.sql.Date and java.sql.Timestamp serialize the
> day/month/year/hour/minute separately instead of storing the time since
> 1970.
>
> See here for more 
> details:http://groups.google.com/group/google-web-toolkit/browse_thread/threa...
>
> Paul
>
> Ameya Kulkarni wrote:
> > We are sending date objects from server. It works for all dates except
> > the older ones. We cannot change the implementation to send strings
> > now.
>
> > How do we set time zone in the application ?
>
> > On Aug 6, 11:26 am, Muhammad <bilal_hobn...@yahoo.com> wrote:
>
> >> Dear ,
>
> >> Please set time zone in your application.
> >> then you may get exact date you want.
>
> >> Muhammad Bilal Ilyas
> >> Software Engineer
>
> >> ________________________________
> >> From: Ameya Kulkarni <amey...@gmail.com>
> >> To: Google Web Toolkit <google-web-toolkit@googlegroups.com>
> >> Sent: Fri, August 6, 2010 11:09:46 AM
> >> Subject: Date Serialization issues
>
> >> Hi
>
> >> We are sending java.util.Date objects from the server. On the client
> >> side these date values are not correct.
>
> >> Examples:
> >> 14-Jul-1000 (on server) is shown as 20-Jul-1000 (on browser)
> >> 14-Jul-0100 (on server) is shown as 13-Jul-0100 (on browser)
>
> >> We are using GWT 2.0. Has anyone faced such issues ?
>
> >> --
> >> 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-tool...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> google-web-toolkit+unsubscr...@googlegroups.com.
> >> For more options, visit this group 
> >> athttp://groups.google.com/group/google-web-toolkit?hl=en.

-- 
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-tool...@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