time: ParseTime layouts with underscores _ #21966
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
I suspect this has been mentioned before, but my searches came up empty.
https://play.golang.org/p/p9ZqFEcoJi
This
fmt.Println(time.Parse("2006-_1-_2", "2017-7-17"))
fails with this0001-01-01 00:00:00 +0000 UTC parsing time "2017-7-17" as "2006-_1-_2": cannot parse "7-17" as "-_"
output.I naively expected
_
-parsing to be less greedy. I'm not sure if this is supposed to work, but maybe it is worth fixing anyway.The text was updated successfully, but these errors were encountered: