Android TimeZone Turkey GMT -


for 2016 turkish government decided stay gmt+3 timezone save daylight, on android:

calendar calendar = calendar.getinstance(); timezone tz = timezone.gettimezone("utc"); calendar.settimeinmillis(timestamp * 1000); date currenttimezone = (date) calendar.gettime(); calendar.add(calendar.millisecond, tz.getoffset(calendar.gettimeinmillis())); 

so problem is;
it's showing gmt+3 date before november:
wed oct 26 18:00:00 gmt+03:00 2016
after november:
mon nov 07 20:00:00 gmt+02:00 2016

it should've stay @ gmt+3 whole year, special issue android lib of timezone or doing wrong?
thanks,

update
although i've added check timezone , gmt parameters,
situation little chaotic android devices uses turkey's timezone, cause after oct 29 hour of device hour normal, until android releases update , user applies that.

see release note of tzdb-database version 2016g:

release 2016g - 2016-09-13 08:56:38 -0700

changes future time stamps

turkey switched eet/eest (+02/+03) permanent +03, effective 2016-09-07.  (thanks burak aydin.)   use "+03" rather invented abbreviation new time. 

obviously, android device still uses outdated timezone version. have following options proceed:

  • wait new android version (not attractive, not recommended).
  • use external library joda-time-android or library time4a use 2016h (threeten-abp still behind, on 2016e).
  • or write own hack using fixed offsets turkey, example timezone.gettimezone("gmt+03")

Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -