-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed as not planned
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
As of Go 1.8.3, the RFC3339 format has several inconsistencies with the actual RFC when parsing a string:
- One digit hours are incorrectly allowed, e.g.,
2017-04-09T0:38:00.00Z. I assume this is because there is nostdZeroHoursimilar tostdZeroHour12("03"). - The format is case sensitive. The RFC says:
NOTE: Per [ABNF] and ISO8601, the "T" and "Z" characters in this syntax may alternatively be lower case "t" or "z" respectively. This date/time format may be used in some environments or contexts that distinguish between the upper- and lower-case letters 'A'-'Z' and 'a'-'z' (e.g. XML). Specifications that use this format in such environments MAY further limit the date/time syntax so that the letters 'T' and 'Z' used in the date/time syntax must always be upper case. Applications that generate this format SHOULD use upper case letters.
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:
RFC822, RFC822Z, RFC1123, and RFC1123Z are useful for formatting; when used with time.Parse they do not accept all the time formats permitted by the RFCs.
suggests that you should be able to parse all time formats permitted by it.
johandorland and leighmcculloch
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.