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 time: move slim test tzdata to testdata directory 2021-04-14 19:38:36 +00:00
tzdata lib/time, time/tzdata: update to 2022a 2022-05-31 08:53:53 +00:00
embed.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
example_test.go time: document hhmmss formats 2022-04-27 00:11:22 +00:00
export_android_test.go time: fix zoneinfo.zip locating logic when built with -trimpath 2022-03-18 20:57:35 +00:00
export_test.go time: fix zoneinfo.zip locating logic when built with -trimpath 2022-03-18 20:57:35 +00:00
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 all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
internal_test.go time: fix zoneinfo.zip locating logic when built with -trimpath 2022-03-18 20:57:35 +00:00
mono_test.go
sleep.go all: gofmt main repo 2022-04-11 16:34:30 +00:00
sleep_test.go time: skip TestTimerModifiedEarlier on plan9/arm 2022-01-06 19:42:27 +00:00
sys_plan9.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
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: make Ticker.Reset(0) panic 2021-11-05 21:13:38 +00:00
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 time: fix zoneinfo.zip locating logic when built with -trimpath 2022-03-18 20:57:35 +00:00
zoneinfo.go all: gofmt main repo 2022-04-11 16:34:30 +00:00
zoneinfo_abbrs_windows.go
zoneinfo_android.go time: fix zoneinfo.zip locating logic when built with -trimpath 2022-03-18 20:57:35 +00:00
zoneinfo_android_test.go time: fix zoneinfo.zip locating logic when built with -trimpath 2022-03-18 20:57:35 +00:00
zoneinfo_goroot.go time: fix zoneinfo.zip locating logic when built with -trimpath 2022-03-18 20:57:35 +00:00
zoneinfo_ios.go time: fix zoneinfo.zip locating logic when built with -trimpath 2022-03-18 20:57:35 +00:00
zoneinfo_js.go time: fix zoneinfo.zip locating logic when built with -trimpath 2022-03-18 20:57:35 +00:00
zoneinfo_plan9.go time: fix zoneinfo.zip locating logic when built with -trimpath 2022-03-18 20:57:35 +00:00
zoneinfo_read.go time: fix zoneinfo.zip locating logic when built with -trimpath 2022-03-18 20:57:35 +00:00
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 time: fix zoneinfo.zip locating logic when built with -trimpath 2022-03-18 20:57:35 +00:00
zoneinfo_windows_test.go