Skip to content

time: large times do not roundtrip through Format/Parse #16639

@zachjs

Description

@zachjs

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version go1.6.3 darwin/amd64
  2. What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/zach/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.6.3/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.6.3/libexec/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"
  1. What did you do?
    I created a time.Time using a large Unix timestampt that corresponds to a date with a year >9999. I formatted the time and parsed the result.
    Playground demo: https://play.golang.org/p/QSE-o48r5c
  2. What did you expect to see?
    I expected Go to be able to parse the time it formatted using the same layout. Given that Format produced the timestamp, time.Parse should be able to parse it.
  3. What did you see instead?
    It returned an error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions