datetime - GWT java.util.Date serialization bug -
gwt doesn't serialize java date properly. when tried sending date created in javascript through wire, found out dates between april 1st (funny) , 25th october years before year 1983 subtracted 1 day.
that means that, say, both 1982-04-01 , 1982-03-31 become 1982-03-31 on java side.
given dates in question, guess kind of dst problem. i've tried googling, , found one other reference describes similar problem.
i tried submitting bug gwt team, curiously wasn't able find bugtracker gwt.
so, questions are:
anyone else run this? i'm on gwt 1.7, , confirm if happens on 2.0 well.
my workaround send dates strings, , parse them on server. knows better workaround?
assuming using java.util.date
question 1: seems fixed in 2.0. i've created both dates above (1982-04-01 , 1982-03-31) , come through correctly server (both represent on server 1982-04-01 , 1982-03-31 respectively). setup is:
- gwt 2.0
- java 1.6
- osx 10.6.2
question 2: pass 'milliseconds since january 1, 1970, 00:00:00 gmt' on async service-which can using gettime() on date object. on server side can instantiate new date passing value in on constructor:
date date = new date(millis);
saves fiddling around formatters , parsers.
Comments
Post a Comment