Skip to content

time: document that time.Parse using time.RFC822/RFC1123 does not accept all possible 822/1123 times #14505

@Ecsy

Description

@Ecsy

Probably all golang versions are affected (any os and arch combination).

https://www.ietf.org/rfc/rfc822.txt
2.4.  *RULE:  REPETITION

          The character "*" preceding an element indicates repetition.
     The full form is:

                              <l>*<m>element

     indicating at least <l> and at most <m> occurrences  of  element.

RFC822 date = 1*2DIGIT month 2DIGIT
expected to work:

"4 Feb 09 21:00 PST"
"04 Feb 09 21:00 PST"

actually working:

"04 Feb 09 21:00 PST"

RFC1123 date = 1*2DIGIT month 2*4DIGIT
expected to work:

"Wed, 4 Feb 09 21:00:57 PST"
"Wed, 4 Feb 2009 21:00:57 PST"
"Wed, 04 Feb 2009 21:00:57 PST"

actually working:

"Wed, 04 Feb 2009 21:00:57 PST"

These examples also apply to the Z version constants (with numeric zone).

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions