diff options
author | David Golden <david@autopragmatic.com> | 2020-04-22 21:16:49 -0400 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2020-06-02 22:20:47 +0000 |
commit | a9cc1051c11f821cb03d63fb9e05930f9e2f9fa5 (patch) | |
tree | e651fc1c262b6df22e6eee27465f48e9355f1d2d /src/time/format.go | |
parent | ee776b41267ee910196b616b7104f0e5ed63d2b2 (diff) | |
download | go-a9cc1051c11f821cb03d63fb9e05930f9e2f9fa5.tar.gz go-a9cc1051c11f821cb03d63fb9e05930f9e2f9fa5.zip |
time: note that formats may parse invalid strings
The existing documentation for time format constants doesn't mention
that they may parse technically-invalid strings, such as single-digit
hours when a two-digit hour is required by a specification. This commit
adds a short warning note to that effect.
Fixes #37616
Change-Id: I6e5e12bd42dc368f8ca542b4c0527a2b7d30acaf
Reviewed-on: https://go-review.googlesource.com/c/go/+/229460
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/time/format.go')
-rw-r--r-- | src/time/format.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/time/format.go b/src/time/format.go index b74108f0e7..f11fb7ed30 100644 --- a/src/time/format.go +++ b/src/time/format.go @@ -67,7 +67,7 @@ import "errors" // that insist on that format, and RFC3339 should be preferred for new protocols. // RFC3339, RFC822, RFC822Z, RFC1123, and RFC1123Z are useful for formatting; // when used with time.Parse they do not accept all the time formats -// permitted by the RFCs. +// permitted by the RFCs and they do accept time formats not formally defined. // The RFC3339Nano format removes trailing zeros from the seconds field // and thus may not sort correctly once formatted. const ( |