aboutsummaryrefslogtreecommitdiff
path: root/src/time/format.go
diff options
context:
space:
mode:
authorcuiweixie <cuiweixie@gmail.com>2022-04-26 23:55:11 +0000
committerGopher Robot <gobot@golang.org>2022-04-27 00:11:22 +0000
commit24b570354caee33d4fb3934ce7ef1cc97fb403fd (patch)
tree38f5b36ca7fb2e020c0869e7976ac693af3a8643 /src/time/format.go
parent68b655f2b91c4407ccd781271039857e0d332989 (diff)
downloadgo-24b570354caee33d4fb3934ce7ef1cc97fb403fd.tar.gz
go-24b570354caee33d4fb3934ce7ef1cc97fb403fd.zip
time: document hhmmss formats
Fixes #52516 Change-Id: I173fdb09c245563e09be4e1aacfd374c3a764d74 GitHub-Last-Rev: 14a81e50616e0f268fee9323d0621de861885475 GitHub-Pull-Request: golang/go#52538 Reviewed-on: https://go-review.googlesource.com/c/go/+/402058 Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/time/format.go')
-rw-r--r--src/time/format.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/time/format.go b/src/time/format.go
index 2f66df668b..5f696189ff 100644
--- a/src/time/format.go
+++ b/src/time/format.go
@@ -64,17 +64,21 @@ import "errors"
//
// Numeric time zone offsets format as follows:
//
-// "-0700" ±hhmm
-// "-07:00" ±hh:mm
-// "-07" ±hh
+// "-0700" ±hhmm
+// "-07:00" ±hh:mm
+// "-07" ±hh
+// "-070000" ±hhmmss
+// "-07:00:00" ±hh:mm:ss
//
// Replacing the sign in the format with a Z triggers
// the ISO 8601 behavior of printing Z instead of an
// offset for the UTC zone. Thus:
//
-// "Z0700" Z or ±hhmm
-// "Z07:00" Z or ±hh:mm
-// "Z07" Z or ±hh
+// "Z0700" Z or ±hhmm
+// "Z07:00" Z or ±hh:mm
+// "Z07" Z or ±hh
+// "Z070000" Z or ±hhmmss
+// "Z07:00:00" Z or ±hh:mm:ss
//
// Within the format string, the underscores in "_2" and "__2" represent spaces
// that may be replaced by digits if the following number has multiple digits,