summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2016-01-06 11:23:03 -0500
committerRuss Cox <rsc@golang.org>2016-01-06 17:59:15 +0000
commit39c3e0f64285b9e3c0c0f750af5ae1aa52be79f6 (patch)
tree80471d47dfa2ad784df774207f76e11a9c040294
parent901810ae5532b669d6e59c3ee64fd390f520499c (diff)
downloadgo-git-39c3e0f64285b9e3c0c0f750af5ae1aa52be79f6.tar.gz
time: document that RFC1123 is wrong for times in UTC
Fixes #13781. Change-Id: Icfac8f2bfc3a4106f646409cfdc053df1e0cd76a Reviewed-on: https://go-review.googlesource.com/18314 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-rw-r--r--src/time/format.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/time/format.go b/src/time/format.go
index 552887609b..fc2136a3f6 100644
--- a/src/time/format.go
+++ b/src/time/format.go
@@ -44,6 +44,13 @@ import "errors"
//
// The executable example for time.Format demonstrates the working
// of the layout string in detail and is a good reference.
+//
+// Note that the RFC822, RFC850, and RFC1123 formats should be applied
+// only to local times. Applying them to UTC times will use "UTC" as the
+// time zone abbreviation, while strictly speaking those RFCs require the
+// use of "GMT" in that case.
+// In general RFC1123Z should be used instead of RFC1123 for servers
+// that insist on that format, and RFC3339 should be preferred for new protocols.
const (
ANSIC = "Mon Jan _2 15:04:05 2006"
UnixDate = "Mon Jan _2 15:04:05 MST 2006"