Wednesday, May 29, 2013

Re: Timezone difference issue

The date doesn't actually get changed. What's happening is that a java.util.Date represents an instance in time. Viewed from different timezones, that instance in time can be at different times of day and even a different day. But it's still the same instance in time.

To avoid this, you might send a date to your server in a format that preserves the day-month-year and time of day, and have your server send dates back in a similar fashion. How you do this depends on how you communicate with your server.

Search the archives and you will find descriptions of this sort of thing. Some people send dates as text strings. Others using GWT RPC override the custom field serializers for java.util.Date, java.sql.Date and java.sql.Timestamp so that RPC sends the day-month-year and hour-minutes-second instead of the default, which is the number of milliseconds since 1970.

Paul

On 29/05/13 14:05, Kedar Vyawahare wrote:
Hi all,

 I am using a date picker in  date box  and  storing the date in database.But database is remotely hosted  which is in different timezone.

So the date get changed as there is timezone difference.

Please suggest some way out.

--

Thanks & regards ,

Kedar 

 

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment