-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: RFC3339 format parsing is both too lax and too strict #20869
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Comments
oschwald
changed the title
RFC3339 format parsing is both too lax and too string
RFC3339 format parsing is both too lax and too strict
Jun 30, 2017
ALTree
changed the title
RFC3339 format parsing is both too lax and too strict
time: RFC3339 format parsing is both too lax and too strict
Jun 30, 2017
ALTree
added
the
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
label
Jun 30, 2017
Change https://golang.org/cl/74231 mentions this issue: |
See also #11128 |
gopherbot
pushed a commit
that referenced
this issue
Oct 31, 2017
For #9346 #22135 explicitly state under layout constants that they are not valid time values for Parse. Also add examples of parsing valid RFC3339 values and the layout to the example for time.Parse. Fix capitalisation of time.Parse and Time.Format. For #20869 include RFC3339 in the list of layouts that do not accept all the time formats allowed by RFCs (lowercase z). This does not fully address #20869. Fixes #9346 Fixes #22135 Change-Id: Ia4c13e5745de583db5ef7d5b1688d7768bc42c1b Reviewed-on: https://go-review.googlesource.com/74231 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
Given that generators should generate T and Z, not t and z, I'm not particularly inclined to try to fix this. |
Duplicate of #54580 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
As of Go 1.8.3, the RFC3339 format has several inconsistencies with the actual RFC when parsing a string:
2017-04-09T0:38:00.00Z
. I assume this is because there is nostdZeroHour
similar tostdZeroHour12
("03").Also, it does not parse leap seconds, which are explicitly allowed under the standard, but that seems more like an intentional design decision.
In reporting this, I am assuming the omission of RFC3339 from the comment:
suggests that you should be able to parse all time formats permitted by it.
The text was updated successfully, but these errors were encountered: