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: Weird behavior with RFC3339 parser #30341

Closed
mcandre opened this issue Feb 21, 2019 · 3 comments

Comments

Projects
None yet
6 participants
@mcandre
Copy link

commented Feb 21, 2019

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

$ go version
go version go1.11 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/tkmamhf/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/tkmamhf/go"
GOPROXY=""
GORACE=""
GOROOT="/Users/tkmamhf/.gvm/gos/go1.11"
GOTMPDIR=""
GOTOOLDIR="/Users/tkmamhf/.gvm/gos/go1.11/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/y6/dbk1vvs179nbpfv38j__10b5rsnf87/T/go-build068103498=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I am trying to parse some RFC3339 timestamps like "2020-04-01T12:00:00Z" with the time package.

What did you expect to see?

Nil error.

What did you see instead?

The RFC3339 parse string appears to reject zero-valued timezone suffixes 00:00

Workaround

I am carefully stripping zero-valued timezone suffixes prior to using time.Parse()

@dmitshur dmitshur changed the title Weird behavior with RFC3339 parser time: Weird behavior with RFC3339 parser Feb 21, 2019

@dmitshur dmitshur added this to the Go1.13 milestone Feb 21, 2019

@antong

This comment has been minimized.

Copy link
Contributor

commented Feb 22, 2019

@mcandre , could you provide a minimal example of code that produces the error, preferably as a playground link like https://play.golang.org/p/Biopib2o853, and tell what actual error you got?

@gopherbot

This comment has been minimized.

Copy link

commented Mar 22, 2019

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this Mar 22, 2019

@iWdGo

This comment has been minimized.

Copy link
Contributor

commented Mar 23, 2019

Details of this issue are probably in #20555 and the error message is as the included example mentions.

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