java - Google App Engine - GAE will not set Default TimeZone -
i have tried following can date based on timezone "africa/johannesburg"
or gmt+2:00
google servers return time using own timezone 2 hours behind mine.
i have done ff:
in appengine-web.xml
have set
<property name="user.timezone" value="africa/johannesburg"/>
i have tried timezone.setdefault(timezone.gettimezone("gmt+2:00"));
before creating date object
in init method of servlet, have tried
@override public void init() throws servletexception { timezone.setdefault(timezone.gettimezone("gmt+2:00")); }
but thing won't work. because jdk date not thread safe, using jodatime, works well, in fact when new datetime(datetimezone.forid("africa/johannesburg"))
correct time legacy issues, have store date in jdk date hence have convert joda jdk date invoking .date(), time screwed in wrong timezone.
does chance know how set without having subtract hours difference.
you can't. system timezone not changeable. should store of dates in unix time , convert them date or calendar object using timezone. not assume gae going use same timezone...
Comments
Post a Comment