]> Cypherpunks repositories - gostls13.git/commit
time: use values larger than 24 for day for time.Format examples
authorJean de Klerk <deklerk@google.com>
Sun, 1 Mar 2020 00:35:51 +0000 (17:35 -0700)
committerRob Pike <r@golang.org>
Mon, 2 Mar 2020 04:25:41 +0000 (04:25 +0000)
commit4978f5e6ea0ba74264b562a3c9ee62dcb63aae45
treea9a9838f3969d122e61610511b2faca59c4c688a
parent529988d62c1ffc3e5332231fc3e977858e5a2351
time: use values larger than 24 for day for time.Format examples

Currently, the time.Format docs use 7 Mar 2015 as the day/month/year. In numeric
form, that is either 7/3/2015 or 3/7/2015 depending on which part of the world
you're from. This is extremely confusing.

In fact, the reference time being defined in a very US-centric way is quite
confusing for the rest of the world, too [1].

We can't change that, but we can make the time.Format docs more comprehendable
to the rest of the world without sacrificing by simply choosing a day that is
not ambiguous (a value greater than 24 for day). This CL does makes the
necessary change.

Note: this CL moves some of the padding examples into their own example, since
those examples do need a <10 day to demonstrate padding.

1: Additional context: a very old golang-nuts thread in which Rob expresses some
regret about the format being the USA standard, rather than the alternative:
https://groups.google.com/forum/m/#!msg/golang-nuts/0nQbfyNzk9E/LWbMgpRQNOgJ.

Change-Id: If0a07c5e0dab86f8420cbf59543405eb857aa7f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/221612
Run-TryBot: Jean de Klerk <deklerk@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/time/example_test.go