-
Notifications
You must be signed in to change notification settings - Fork 30
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
convertTimes.go from ch02 not parsing time zone correctly #1
Comments
Even the example from the book doesn't work on my system:
|
This is strange –
|
This is very strange. I ran it on 2 different machines and I get the same wrong results on both. Both machines run Linux, one is Archlinux, the other is Fedora 38. I also ran it in a container using the official Go image and I got the same wrong results. Tested both Go 1.20 and Go 1.21 |
This is on a Linux machine:
Can you please run a |
So strange. I just updated my Archlinux and ran a
Running on a Thinkpad T14 |
On a different Arch Linux machine, I got the following:
Maybe it is because we live at different locations. I cannot think of anything else. |
This is too weird. And the code looks good to me but I keep getting the wrong results, no matter where I run it. More examples: Fedora 38 Virtual Machine, running on Dell server KVM hypervisor:
Containers:
|
It seems to be a known Go issue: golang/go#63345 |
Thanks for pointing that out! Closing the issue. |
convertTimes.go
from ch02 not parsing all time zones correctly.I have not yet figured out if it's a bug with Go or something on my system but I wanted to report so you can also take a look.
For example, when I execute this program providing an input with time zones MDT, MST, PDT, or PST, it parses them as UTC. To test, I added another location for PDT time zone to check and the times should match but don't.
Example output:
but if I use EDT instead, it works:
I also noticed that using an inexisting time zone, it also parses it as UTC:
The text was updated successfully, but these errors were encountered: