Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
time: cannot roundtrip Parse the Time.String output #20876
Regression from Go1.8.
On tip, the documentation of
This is misleading since it suggests that the following should work:
time.Parse("2006-01-02 15:04:05.999999999 -0700 MST", time.Now().String())
However, this does not work on Go1.9 since:
We should done one of the following:
The initial report is misleading. The full docs for time.Time.String say:
Are you aware of anyone round-tripping the output of String in production code? I am not. It's a mistake anyway since the String output gives the time zone twice, the second one will override the first one, and it's the less specific of the two.
If there are widespread production uses of String output being fed into time.Parse, let me know.
Otherwise, if someone wants to add to the end of the doc comment that