Skip to content
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: Parse not parsing PST properly on playground #12388

Closed
vivekmenezes opened this issue Aug 28, 2015 · 5 comments

Comments

Projects
None yet
4 participants
@vivekmenezes
Copy link

commented Aug 28, 2015

http://play.golang.org/p/NYza3grttO

As you see PST is landing up with an offset from UTC of 0!

The correct answer is as documented in

https://golang.org/src/time/example_test.go line 196

Thanks

@vivekmenezes

This comment has been minimized.

Copy link
Author

commented Aug 28, 2015

This is in go 1.5

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2015

The playground does not have timezone information.

Time zone names like PST are parsed based on your local timezone information. On my Ubuntu GNU/Linux system, I get the correct value because the file /usr/share/zoneinfo/PST8PDT exists. If a file like that does not exist on your system, then the results are expected.

I'm closing this as expected, but please feel free to reopen if you disagree.

@vivekmenezes

This comment has been minimized.

Copy link
Author

commented Aug 29, 2015

Sounds good.

// printed for 1970-2469 will apply as well to 2470-2869. Even the days

Can you change the years on this line to 1970-2369 and 2370-2769

Thanks!

@minux

This comment has been minimized.

Copy link
Member

commented Aug 29, 2015

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2015

@mikioh mikioh changed the title time.Parse not parsing PST properly time: Parse not parsing PST properly on playground Aug 29, 2015

@golang golang locked and limited conversation to collaborators Sep 4, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.