-
Notifications
You must be signed in to change notification settings - Fork 18k
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
time: Date returns a Time object with incorrect offset for years 1900-1905 #30099
Comments
Change https://golang.org/cl/161202 mentions this issue: |
This is happening because we were only reading the 32-bit version of the tzdata info, which can't represent times before December 13, 1901. |
@ianlancetaylor What about "Asia/Calcutta", of which the anomaly seems to continue beyond 1901. |
It seems to me that with CL 161202 the times printed for "Asia/Calcutta" match the information in the tzdata database.
|
Thanks @ianlancetaylor for investigation! And thanks @bradfitz for including the issue for next release! In the meantime, I have my own wrapper around time.Date and limit the year to 1970 (an arbitrarily picked year that is just old enough :) |
@ianlancetaylor which version of go has this 64-bit reading fix been ported in? the label says go1.13, but I'm wondering if 1.12.4 has it or not, seems like my repro test works correctly now under 1.12.4. |
@jinfengnarvar The patch that fixed the problem is not on the 1.12 branch. I have no explanation. Perhaps the tzdata information on your system changed in some way? |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Don't know. I did repro this issue on https://play.golang.org/.
What operating system and processor architecture are you using (
go env
)?What did you do?
Here is the repro code:
What did you expect to see?
What did you see instead?
Similar output for "Asia/Calcutta" time zone, except the deviation lasts through 1905:
The text was updated successfully, but these errors were encountered: