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 of RFC3339 is incorrect for hour field #54568

Open
dsnet opened this issue Aug 21, 2022 · 4 comments
Open

time: Parse of RFC3339 is incorrect for hour field #54568

dsnet opened this issue Aug 21, 2022 · 4 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@dsnet
Copy link
Member

dsnet commented Aug 21, 2022

RFC 3339, section 5.6 specifies that the time-hour field must be two digits wide.

However, Parse permits that field having only a single digit:

Parse(time.RFC3339, "0000-01-01T0:00:00+00:00")

reports nil rather than an error.

@seankhliao
Copy link
Member

seankhliao commented Aug 21, 2022

same as #29911 ?

@dsnet
Copy link
Member Author

dsnet commented Aug 21, 2022

It's related. If we're unwilling to change the meaning of "15", we could detect that the format is RFC3339 and perform a stricter check.

@gopherbot
Copy link

gopherbot commented Aug 21, 2022

Change https://go.dev/cl/425044 mentions this issue: time: fix Parse to reject single digit hour in RFC3339

@seankhliao seankhliao added the NeedsFix The path to resolution is known, but the work has not been done. label Aug 24, 2022
@gopherbot
Copy link

gopherbot commented Aug 27, 2022

Change https://go.dev/cl/426154 mentions this issue: time: parse time with two digits hour for RFC3339 format.

@seankhliao seankhliao added this to the Go1.20 milestone Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants