-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: time.Time get wrong local time zone for some days #16553
Comments
and for my |
continue.. I found that |
It seems there is something wrong in I tried to reproduce the issue of timezone to verify whether the issue is up to your computer or not. Actually, I could reproduce error identical to your error. This implies the issue is a bug of Go. https://play.golang.org/p/NKrG7ctjq8 The above depicts the bug, not why happens, for these who don't live in China, such as me living in Korea. I think that the bug stems from |
oh~~ It seem be +09:00 mean DST...not |
Closed ... thx @catalase |
I didn't consider dst! learn something new today. |
Hi,
I have create
time.Time
for1986-05-04
using time.Date(), and then useZone()
orFormat
to display it...but for
1986-05-04
, timeZone will beCDT +09:00
, not my Local time in China(+08:00), but for2017-08-01
it works well...I try to read code in
time.Date()
, it will do some adjust when time second too close to a zone transition...so it first getCDT
then adjust toCST
, but haven't found that in othertime.lookup()
usage, and they returnCDT
directly, what about this?- -go version
)?go1.6.2
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/didi/Code/go:/Users/didi/.gvm/pkgsets/go1.6.2/global"
GORACE=""
GOROOT="/Users/didi/.gvm/gos/go1.6.2"
GOTOOLDIR="/Users/didi/.gvm/gos/go1.6.2/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
and I'm in China.. CST +08:00
run a simple main.go
What did you expect to see?
CST 28800 1986-05-04T00:00:00+08:00
CST 28800 2016-08-01T00:00:00+08:00
What did you see instead?
CDT 32400 1986-05-04T01:00:00+09:00
CST 28800 2016-08-01T00:00:00+08:00
The text was updated successfully, but these errors were encountered: