Skip to content

time: set specific rule for Date on daylight savings transitions #24551

@jleben

Description

@jleben

What version of Go are you using (go version)?

go1.7.4 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/usr/lib/go-1.7"
GOTOOLDIR="/usr/lib/go-1.7/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build628236315=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1

What did you do?

I called time.Date for March 11, 2018, 2:00 AM, and printed the resulting time.
https://play.golang.org/p/N-XUwlGxpaF

What did you expect to see?

March 11, 2018, 2:00 AM is the moment when the clock in Vancouver changes to 3:00 AM due to switching from PST to PDT. So I would expect one of the following:

  • Either 2:00 is interpreted in PST, and the time printed is 2:00 PST
  • Or 2:00 is interpreted in PDT, and the time printed is 2:00 PDT

What did you see instead?

Instead, time.Date apparently interprets 2:00 in PDT, but prints 1:00 PST.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions