Timeline for Where does Go's datetime formatting pattern come from? And why was it chosen?
Current License: CC BY-SA 4.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 17 at 19:12 | comment | added | user76284 | FWIW, the ISO date standard is YYYY-MM-DD, which disambiguates itself from the American convention. (Note the dashes and 4-digit year.) | |
Mar 5 at 22:15 | comment | added | Barmar | @SilvioMayolo I also agree, which is why I qualified it with "they thought". Maybe it's how the programmer who designed this liked to write dates. But it's pretty close to how Americans write dates and time, the main difference being the location of the year. | |
Mar 5 at 20:20 | comment | added | Jörg W Mittag |
@SilvioMayolo: Agreed. I would probably have chosen something like 12-03-04T5:6:7.8-09 in a subset of ISO 8601 / RFC 3339.
|
|
Mar 5 at 17:00 | comment | added | chepner |
mm/dd/yyy is no more "arbitrary" than any other format: it's a direct reflection of spoken English "<name of month> <day>th, <name of year>". I would argue against using this convention, though, just as strongly as I would the European convention of dd/mm/yyyy , and recommend yyyy/mm/dd in its place.
|
|
Mar 4 at 21:34 | comment | added | Silvio Mayolo | I am an American and I would have to look up that date every time. There's nothing intuitive about the order. | |
Mar 4 at 21:10 | comment | added | Barmar | @SilvioMayolo "This date" isn't random. They just use sequential 2-digit numbers for each field in the date. You only have to remember the order of fields, which I guess they thought would be intuitive for Americans. | |
Mar 4 at 21:04 | comment | added | Barmar | @user23013 Although separating the year like that is not common. We usually write MM/DD/YY. Seems like they deliberately chose this format to be weird, maybe even to emphasize how broken the American style can be. | |
Mar 4 at 5:39 | comment | added | user23013 | "It is a regrettable historic error that the date uses the American convention of putting the numerical month before the day." I'm guessing it is from "American convention", i.e. the developer picked an arbitrary format that they thought is conventional. | |
Mar 4 at 3:53 | comment | added | Silvio Mayolo | I imagine what they were going for was "I don't want to memorize all of these arcane single-letter abbreviations to make a format string, so we'll just remember this one date". But then, of course, it just moves the goalpost from "memorize format directives" to "memorize the order of numbers in this date". Needless to say, I've never seen this done anywhere else. | |
Mar 3 at 22:38 | history | edited | bigyihsuan | CC BY-SA 4.0 |
added 43 characters in body
|
Mar 3 at 7:13 | comment | added | Jasmijn | In what way do you mean "come from"? Are you looking for precedents? | |
Mar 3 at 2:56 | history | asked | bigyihsuan | CC BY-SA 4.0 |