From 2c12b81739ec2cb85073e125748fcbf5d2febb2c Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 26 Jan 2016 18:55:35 +0000 Subject: [PATCH] net/http: document TimeFormat more Fixes #14103 Change-Id: I89963643eccc902b809e04b7a14153acb0d242e1 Reviewed-on: https://go-review.googlesource.com/18933 Reviewed-by: Ian Lance Taylor --- src/net/http/server.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/net/http/server.go b/src/net/http/server.go index 2ec106927b..004a1f92fc 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -648,10 +648,12 @@ func (ecr *expectContinueReader) Close() error { return ecr.readCloser.Close() } -// TimeFormat is the time format to use with -// time.Parse and time.Time.Format when parsing -// or generating times in HTTP headers. -// It is like time.RFC1123 but hard codes GMT as the time zone. +// TimeFormat is the time format to use when generating times in HTTP +// headers. It is like time.RFC1123 but hard-codes GMT as the time +// zone. The time being formatted must be in UTC for Format to +// generate the correct format. +// +// For parsing this time format, see ParseTime. const TimeFormat = "Mon, 02 Jan 2006 15:04:05 GMT" // appendTime is a non-allocating version of []byte(t.UTC().Format(TimeFormat)) -- 2.48.1