Re: Timezone difference issue

2013-05-30 Thread David
Hi,

The question was indeed directed to the OP :-)

David

On Wed, May 29, 2013 at 5:27 PM, Andy  wrote:

> Hi David,
>
> I can't tell if you're asking me or the OP, but I'll tell you what we're
> doing it and I believe it is what Kedar should be doing.
>
> The UTCDateBox implements HasValue and we pass a Long over RPC and
> store a Long on the server. This number always represents midnight in GMT
> on a selected date.
>
>
> On Wednesday, May 29, 2013 10:59:47 AM UTC-4, stuckagain wrote:
>
>> Hi,
>>
>> How are you sending the date over RPC ? as a Date ? And how are you
>> storing it ? as a string ?
>> The Date object does not allow you to change the timezone, it is always
>> using the local one since it does not store it with the Date object.
>>
>> AFAIK the Date object behaves correctly in GWT, it can sometimes be a bit
>> strange if you don't include the timezone or when sometimes you convert it
>> to a string in the browser vs on the server side and those machines are in
>> a different timezone.
>>
>> David
>>
>> On Wed, May 29, 2013 at 3:05 PM, 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+**unsubscr...@googlegroups.com.
>>> To post to this group, send email to google-we...@**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
>>> .
>>>
>>>
>>>
>>
>>  --
> 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+unsubscr...@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.
>
>
>

-- 
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+unsubscr...@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.




Re: Timezone difference issue

2013-05-29 Thread Andy
Hi David,

I can't tell if you're asking me or the OP, but I'll tell you what we're 
doing it and I believe it is what Kedar should be doing.

The UTCDateBox implements HasValue and we pass a Long over RPC and 
store a Long on the server. This number always represents midnight in GMT 
on a selected date.


On Wednesday, May 29, 2013 10:59:47 AM UTC-4, stuckagain wrote:
>
> Hi,
>
> How are you sending the date over RPC ? as a Date ? And how are you 
> storing it ? as a string ?
> The Date object does not allow you to change the timezone, it is always 
> using the local one since it does not store it with the Date object.
>
> AFAIK the Date object behaves correctly in GWT, it can sometimes be a bit 
> strange if you don't include the timezone or when sometimes you convert it 
> to a string in the browser vs on the server side and those machines are in 
> a different timezone.
>
> David
>
> On Wed, May 29, 2013 at 3:05 PM, 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+unsubscr...@googlegroups.com .
>> To post to this group, send email to 
>> google-we...@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.
>>  
>>  
>>
>
>

-- 
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+unsubscr...@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.




Re: Timezone difference issue

2013-05-29 Thread David
Hi,

How are you sending the date over RPC ? as a Date ? And how are you storing
it ? as a string ?
The Date object does not allow you to change the timezone, it is always
using the local one since it does not store it with the Date object.

AFAIK the Date object behaves correctly in GWT, it can sometimes be a bit
strange if you don't include the timezone or when sometimes you convert it
to a string in the browser vs on the server side and those machines are in
a different timezone.

David

On Wed, May 29, 2013 at 3:05 PM, Kedar Vyawahare <
kedar.vyawahare1...@gmail.com> 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+unsubscr...@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.
>
>
>

-- 
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+unsubscr...@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.




Re: Timezone difference issue

2013-05-29 Thread Andy

A java.util.Date will always have a time component because it is 
represented as the number of seconds since 1970.

The UTCDateBox normalizes that time component to midnight in GMT so that it 
will work in all timezones.

The DateBox does not normalize the time component so the Date in the 
DateBox will depend on the timezone. As I understood, this is his problem 
and this is the reason we created the UTCDateBox.

On Wednesday, May 29, 2013 10:34:10 AM UTC-4, Satyarao Kambapu wrote:
>
> Hello Andy, 
>   As per my experience the difference between DateBox and UTCDateBox is 
> Time Component. The UTCDateBox returns the date with specific time, where 
> as DateBox is not.
>  I think, the problem of  Kedar Vyawahare is not this one.
>
>
>
> On Wed, May 29, 2013 at 7:52 PM, Andy >wrote:
>
>> There are many threads about these issues. We solved this problem by 
>> wrapping the DateBox with a class called UTCDateBox that you can get here: 
>> http://code.google.com/p/gwt-traction/
>>
>> I wrote about it here: 
>> http://traction.tractionsoftware.com/traction/permalink/Blog1986
>>
>> Cheers,
>> Andy
>>
>> On Wednesday, May 29, 2013 9:05:03 AM UTC-4, 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+unsubscr...@googlegroups.com .
>> To post to this group, send email to 
>> google-we...@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.
>>  
>>  
>>
>
>
>
> -- 
> Satya
>  

-- 
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+unsubscr...@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.




Re: Timezone difference issue

2013-05-29 Thread Satyarao Kambapu
Hello Andy,
  As per my experience the difference between DateBox and UTCDateBox is
Time Component. The UTCDateBox returns the date with specific time, where
as DateBox is not.
 I think, the problem of  Kedar Vyawahare is not this one.



On Wed, May 29, 2013 at 7:52 PM, Andy  wrote:

> There are many threads about these issues. We solved this problem by
> wrapping the DateBox with a class called UTCDateBox that you can get here:
> http://code.google.com/p/gwt-traction/
>
> I wrote about it here:
> http://traction.tractionsoftware.com/traction/permalink/Blog1986
>
> Cheers,
> Andy
>
> On Wednesday, May 29, 2013 9:05:03 AM UTC-4, 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+unsubscr...@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.
>
>
>



-- 
Satya

-- 
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+unsubscr...@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.




Re: Timezone difference issue

2013-05-29 Thread Andy
There are many threads about these issues. We solved this problem by 
wrapping the DateBox with a class called UTCDateBox that you can get 
here: http://code.google.com/p/gwt-traction/

I wrote about it 
here: http://traction.tractionsoftware.com/traction/permalink/Blog1986

Cheers,
Andy

On Wednesday, May 29, 2013 9:05:03 AM UTC-4, 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+unsubscr...@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.




Re: Timezone difference issue

2013-05-29 Thread Paul Robinson
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+unsubscr...@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.
>  
>  

-- 
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+unsubscr...@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.




Timezone difference issue

2013-05-29 Thread Kedar Vyawahare
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+unsubscr...@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.