go/src/time
Marcus Watkins dcea1ee6e3 time: clarify documentation for allowed formats and add tests to prove them
The existing documentation for the time.Layout const states "Only these values
are recognized", but then doesn't include the numeric forms for month leading to
ambiguity and assumptions that may not be true. It's unclear, for example,
that space padding is only available for day of the month.

Finally I add tests to show the behaviors in specific scenarios.

Change-Id: I4e08a14834c17b6bdf3b6b47d39dafa8c1a138fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/418875
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-07-25 16:15:08 +00:00
..
testdata
tzdata lib/time, time/tzdata: update to 2022a 2022-05-31 08:53:53 +00:00
embed.go
example_test.go time: document hhmmss formats 2022-04-27 00:11:22 +00:00
export_android_test.go
export_test.go
export_windows_test.go
format.go time: clarify documentation for allowed formats and add tests to prove them 2022-07-25 16:15:08 +00:00
format_test.go time: clarify documentation for allowed formats and add tests to prove them 2022-07-25 16:15:08 +00:00
genzabbrs.go
internal_test.go
mono_test.go
sleep.go all: gofmt main repo 2022-04-11 16:34:30 +00:00
sleep_test.go
sys_plan9.go
sys_unix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
sys_windows.go time: return ENOENT instead of ERROR_PATH_NOT_FOUND in windows 2022-05-08 17:19:07 +00:00
tick.go all: replace `` and '' with “ (U+201C) and ” (U+201D) in doc comments 2022-04-05 17:52:29 +00:00
tick_test.go
time.go time: add Time.ZoneBounds 2022-05-17 03:26:28 +00:00
time_test.go time: add Time.ZoneBounds 2022-05-17 03:26:28 +00:00
tzdata_test.go
zoneinfo.go all: gofmt main repo 2022-04-11 16:34:30 +00:00
zoneinfo_abbrs_windows.go
zoneinfo_android.go
zoneinfo_android_test.go
zoneinfo_goroot.go
zoneinfo_ios.go
zoneinfo_js.go
zoneinfo_plan9.go
zoneinfo_read.go
zoneinfo_test.go internal/testenv: add GOROOT and use it to fix tests broken with -trimpath 2022-03-18 21:55:52 +00:00
zoneinfo_unix.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
zoneinfo_unix_test.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
zoneinfo_windows.go
zoneinfo_windows_test.go