-
Notifications
You must be signed in to change notification settings - Fork 18k
time: time.Parse does not work properly #20880
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
Comments
If you are in
Don't assume the timezone abbreviation will be printed as
In your 2018 date the abbreviation is printed as |
@ALTree I'm well aware of that. I believe Go should have a work around to have things working despite this issue, at least Go should count (+02/+03) as EET/EEST. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go1.8.3 darwin/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
What did you do?
This issue come up when I need to parse a datetime string that is generated by a pseudo random datetime generator that uses Unix() function. The generated datetime takes various date and time pairs between 2010 and 2017. Here's the problem, this version of the code works on both my computers and the playground,
But the version below works on playground and panics on my computers. I believe that the problem is that my computers' timezone is setted for GMT+3.
What did you expect to see?
I was expecting to have a time.Time object that is parsed from output of Stringer method.
What did you see instead?
panic: parsing time "2017-12-31 03:00:00 +0300 +03" as "2006-01-02 15:04:05.999999999 -0700 MST": cannot parse "+03" as "MST"
The text was updated successfully, but these errors were encountered: