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: large times do not roundtrip through Format/Parse #16639

Closed
zachjs opened this issue Aug 8, 2016 · 4 comments
Closed

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

zachjs opened this issue Aug 8, 2016 · 4 comments

Comments

@zachjs
Copy link

zachjs commented Aug 8, 2016

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.
@bradfitz
Copy link
Contributor

bradfitz commented Aug 8, 2016

Doesn't seem worth caring about.

Do you actually care for some reason?

@quentinmit quentinmit added this to the Unplanned milestone Aug 8, 2016
@zachjs
Copy link
Author

zachjs commented Aug 8, 2016

This issue came to my attention when one of the customers for the software I work on filed a ticket about it.

I agree that it’s pretty ridiculous, but the software I work on may be used in some ridiculous ways, and I don’t want to lose support because the programming language’s standard library supports only the minimum ISO standard rather than the maximum (including optional bits).

@bradfitz
Copy link
Contributor

bradfitz commented Aug 8, 2016

Lose whose support? It sounds like they filed a ticket against you, so you are support, no? If your software needs to support years past 9999, you might have to write some specialized code instead of using the time package.

There are many things the time package doesn't do (like leap seconds: #15247, etc) or non-Gregorian calendars. It only aims to address the most common cases.

@rsc
Copy link
Contributor

rsc commented Feb 4, 2017

Not going to worry about this.

@rsc rsc closed this as completed Feb 4, 2017
@golang golang locked and limited conversation to collaborators Feb 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants