1
0
mirror of https://github.com/golang/go synced 2024-11-12 08:50:22 -07:00

net/http: document TimeFormat more

Fixes #14103

Change-Id: I89963643eccc902b809e04b7a14153acb0d242e1
Reviewed-on: https://go-review.googlesource.com/18933
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Brad Fitzpatrick 2016-01-26 18:55:35 +00:00
parent bdc3db0b0c
commit 2c12b81739

View File

@ -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))