New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
China is a single timezone #3
Comments
Thanks for posting this issue! TimezonePicker.com is based upon the standard Timezone DB timezones, which lists China as having 5 timezones (its actually a few more than that but it looks like 5: http://en.wikipedia.org/wiki/Time_in_China#IANA_time_zone_database). It looks to me like even though these timezone names and boundaries are correct, it's only the offset that is wrong. In the case of China we should make a special exception for its timezones and set the offsets manually, making all 5 zones share the same offset as Asia/Shanghai. |
FWIW, I use pytz in the back end, which uses the Olson database. The diagram over at Wikipedia shows four zones for China. As long as the widget and the backend use the same tz db, I guess it works. |
Right, right. The Olson database another name for the Timezone Database (or the IANA Time Zone Database). China does have 5 timezone divisions. It's just that they're all the same timezone offset. |
Hahah, I just figured out why this is occurring. It's because we used the UNIX epoch Jan 1 1970 as our empty time for comparison. And in 1970, China did have 5 different timezone offsets. If we use Jan 1 2012 instead, the offsets are calculated properly for China. |
Well Wikipedia says that China has had a single timezone since 1949. So I'm not sure what the deal is. The above commit has fixed the problem. Now that I know PHP will generate different offsets based on the given date this should fix a couple other issues as well. http://timezonepicker.com/ has been updated to reflect the change. |
Looks like Libya's just announced DST change will need the map to be refreshed again. http://www.timeanddate.com//news/time/libya-time-zone-change-2012.html |
We always show the map in a non-DST state, otherwise the grouping appear very sporadic as countries do or do not support DST. So the addition of DST to a timezone makes no difference to the presentation of the map. |
Ah, but Libya changed not only their DST but the timezone offset entirely:
|
Our offsets are generated by PHP's implementation DateTimezone class, so next time we update PHP on timezonepicker.com it will affect generated maps. The codebase doesn't contain any offset information by itself. |
The imagemap at timezonepicker.com shows China as four zones. However, China is a single timezone. India and Nepal are highlighted together, but India is +0530 while Nepal is +0545.
My application is dependent on the timezone string ("Asia/Kolkata"), so the imagemap is not a deal breaker, but accurate boundaries for the zones would be nice.
The text was updated successfully, but these errors were encountered: