Navigation Menu

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: Format() produce some strange string #13103

Closed
fffw opened this issue Oct 30, 2015 · 2 comments
Closed

time: Format() produce some strange string #13103

fffw opened this issue Oct 30, 2015 · 2 comments

Comments

@fffw
Copy link

fffw commented Oct 30, 2015

Similar issue might already be logged but hope this can be a useful test case.

Version: both 1.5.1 and 1.4.3

Example code at http://play.golang.org/p/R9dgBT5joU

time.Now().Format("Fri, 22 Oct 2015 11:52:25 GMT") produces something like

Fri, 1010 Oct 101100 1111:0010:1000 GMT

@minux
Copy link
Member

minux commented Oct 30, 2015

the format string needs to specify the formatting for
a fixed date:
Mon Jan 2 15:04:05 MST 2006

Please refer to https://golang.org/pkg/time for more
information.

@minux minux closed this as completed Oct 30, 2015
@fffw
Copy link
Author

fffw commented Oct 30, 2015

I looked at the doc several times before created the issue, but as a non-native English speaker, I didn't get your point until I read the doc over and over again for 15 minutes. It's REALLY REALLY counter-intuitive to generate some random string for invalid input.

@golang golang locked and limited conversation to collaborators Nov 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants