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

log: uses weird date format (probably US, or iranian) #6095

Closed
gopherbot opened this issue Aug 9, 2013 · 1 comment
Closed

log: uses weird date format (probably US, or iranian) #6095

gopherbot opened this issue Aug 9, 2013 · 1 comment

Comments

@gopherbot
Copy link

by kyrieuon:

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. import "log"
2. log.Println("Bye.")

http://play.golang.org/p/5LKl63qun5

What is the expected output?
I would expect to see a timestamp printed in a culture neutral, unambigous, and standard
date format (preferably the standard ISO 8601 format YYYY-MM-DDTHH:mm:ss.sssZ, with
fractional seconds, or its local time counterpart).

What do you see instead?
Instead something like
 2013/08/08 23:00:00 Bye.
is printed.

Which compiler are you using (5g, 6g, 8g, gccgo)?
n.n.

Which operating system are you using?
Windows 7


Which version are you using?  (run 'go version')
go version go1.1 windows/amd64

Please provide any additional information below.
See https://en.wikipedia.org/wiki/Date_format_by_country.
@bradfitz
Copy link
Contributor

bradfitz commented Aug 9, 2013

Comment 1:

Your issue isn't with Go, but with the log package's date format.
Per the comment at the top of the log package docs:
    // Bits or'ed together to control what's printed. There is no control over the
    // order they appear (the order listed here) or the format they present (as
    // described in the comments).  A colon appears after these items:
    //  2009/01/23 01:23:23.123123 /a/b/c/d.go:23: message
Considering that there aren't 23 months, it's obviously yyyy/mm/dd.  So it's ISO 8601,
but with slashes instead of hyphens.  Sorry, this is probably just "Unfortunate".  We
can't change it now.  But it's not a weird US or Europe time format with years at the
end.  It sorts lexicographically.

Status changed to Unfortunate.

This issue was closed.
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