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: Parse does not handle negative years #7136

Closed
gopherbot opened this issue Jan 16, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@gopherbot
Copy link

commented Jan 16, 2014

by achun.SHX:

look this:

fmt.Println(time.Parse("2006", "-0001"))

output:

0001-01-01 00:00:00 +0000 UTC parsing time "-0001" as "2006": cannot
parse "-0001"

http://play.golang.org/p/noXxxdh6hR
@robpike

This comment has been minimized.

Copy link
Contributor

commented Jan 16, 2014

Comment 1:

Since Format prints negative years, Parse should handle them.
@robpike

This comment has been minimized.

Copy link
Contributor

commented Jan 16, 2014

Comment 2:

There are many time values that fall outside the range that Parse can handle. It's
unfortunate but also unimportant, since they will arise only in very exceptional
circumstances.

Status changed to Unfortunate.

@golang golang locked and limited conversation to collaborators Jun 25, 2016

This issue was closed.

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