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: system TZ is UTC, but time.Local != time.UTC #9832
Comments
It wasn't clear whether or not you're aware of http://golang.org/pkg/time/#Time.Equal. I'm not sure |
See the note about == at http://golang.org/pkg/time/#Time . |
TBH I was using time.Time as map keys when I stumbled on this, so I couldn't use Time.Equal anyways. The code above was just a minimal test case, since even when trying to debug this the output matched exactly. I had to dig all the way into zoneinfo_unix.go to see that they weren't the same value. |
@ianlancetaylor I've seen the note, but it's not clear that Local = "UTC" and UTC = "UTC" are different things. Obviously bugs/docs are up to y'all, at least now if someone else has the issue they'll be able to google this particular edge case. Cheers |
@pbnjay please note, that you actually CAN use times as map keys, if you call .UTC() before storing them, since t1.UTC() == t2.UTC() => true, iff t1.Equal(t2) => true |
yeah that's what I'm doing now.... but again, docs make it unclear that I Jeremy On Tue, Feb 10, 2015 at 4:22 PM, Ingo Oeser notifications@github.com
|
This was a very unexpected bug, considering all output and other logging statements matched up.
$ cat tt.go
$ go run tt.go
go version devel +2d02ff2 Sat Dec 13 10:18:27 2014 +0000 linux/amd64
The text was updated successfully, but these errors were encountered: