Commit 2c12b817 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

net/http: document TimeFormat more

Fixes #14103

Change-Id: I89963643eccc902b809e04b7a14153acb0d242e1
Reviewed-on: https://go-review.googlesource.com/18933Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent bdc3db0b
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment