-
Notifications
You must be signed in to change notification settings - Fork 51
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
Issues with GMT+-X - minutes instead of hours #26
Comments
Thank you, you are correct. My Olson database script incorrectly interpreted an offset of the format "HH" as minutes instead of hours. (Most of the offsets are "HH:MM".) I will post a fix shortly. |
Sweet! Jesse Gumm
|
Well, the database is not correct, the clock in GMT+X zone faster than GMT+0, so for example GMT+8 should plus 480 minutes not minus. |
The file tzdata/etcetera file in the Olson database says:
|
Well, isn't that just the most confusing thing ever. |
@dhull "Asia/Shanghai" is "GMT+8" , the offset is 480 min see: https://github.com/dmitryme/erlang_localtime/blob/master/include/tz_database.hrl#L349 And more explain http://wwp.greenwichmeantime.com/time-zone/gmt-plus-8/ |
My gut tells me that most people would expect the GMT+X format to be consistent with common usage versus the POSIX-style, but I don't know. Perhaps this is something that should be configurable, otherwise, I will gladly make it an option in qdate that if GMT+-X is the exclusive format of a timezone, that it will interpret as expected. The POSIX standard for the "GMT+/-X" timezones sounds -- to me -- to be completely broken, but then again, I'm sure there's a reason for it. Then again, just like the "REFERER" header in HTTP, the reason may very well be "I didn't know how to spell 'Referrer'". |
For now, in the branch I'm using with qdate, I've got @jacktang's commit that reverses the + and - with the GMT+5 since I suspect that's what folks expect. But I'm wondering if maybe it would be worthwhile to add an alternative to the tz_data to have the "Etc/GMT+1" work like we'd expect, and add something like "Posix/GMT+1". Or, alternatively, since "Etc/GMT+X" is the current posix standard, to add additional non-standard records like "Unposix/GMT+X" which work the reverse of the posix standard, and then re-alias "GMT+X" to the respective "Unposix/GMT+X" Thoughts? |
Hi Dmitry,
In https://github.com/dmitryme/erlang_localtime/blob/master/include/tz_database.hrl#L430-L456 there is an issue with the GMT+X or GMT-X timezones where it's only increment single minutes, rather than multiples of 60 minutes.
So for example, GMT+1 is subtracts 1 minute from the time, rather than 60 minutes, as it should.
I suspect it's a bug in the timezone generation script (https://github.com/dmitryme/erlang_localtime/blob/master/db/tz-erl). I haven't taken the time to go through that script to try to identify the source of the error, but my gut tells me @dhull, as the script's author according to the git history might be able to shed some light on this.
I could update the tz_database.hrl file directly, but that seems like the wrong solution. It should be fixed at the script level, I think.
The text was updated successfully, but these errors were encountered: