Date passed via Request Factory always reduced by 8 hours
51 views
Skip to first unread message
Owen Ilagan
unread,
Oct 11, 2011, 1:00:26 AM10/11/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Web Toolkit
Hello all,
I've run into a problem with passing dates from a GWT client to a
backend service via Request Factory. It would seem that in my case
that whatever date value my GWT application would pass gets reduced by
8 hours when it reaches the back end service being invoked. This
appears like some automatic timezone adjustment that I was not told
about. This is a problem since the date/time value is always different
from what the client submitted. To further illustrate lets say I have
a DateBox user input on my application whose value is obtained using
DateBox.getValue(). This value is passed on to the back-end via
RequestFactory's serviceContext.myService(value). But when
myService(Date value) on the back end is executed, the value received
is 8 hours less than what was originally sent by the client.
We ran into this problem when we changed the formatting of a DateBox
to simply "MM/dd/yyyy" which resulted in the time value submitted to
00:00:00 from 12:00:00. But the back end would receive a date that is
actually the previous day because it was somehow reduced by 8 hours.
- Owen
Thomas Broyer
unread,
Oct 11, 2011, 12:05:39 PM10/11/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
I believe RequestFactory always talks UTC; and the Date you're getting on the server-side probably is UTC, whereas the date typed in on the client side was in the client's timezone (what the browser says, which is what the OS says).