1
0
mirror of https://github.com/golang/go synced 2024-11-23 15:50:07 -07:00

time: make it clearer that the reference time is the reference time.

Because the reference time is the reference time but beginners seem
to think otherwise, make it clearer you can't choose the reference time.

LGTM=josharian, dave
R=golang-codereviews, josharian, dave
CC=golang-codereviews
https://golang.org/cl/117250044
This commit is contained in:
Rob Pike 2014-07-28 17:24:39 -07:00
parent 30fbcc7576
commit d3fb02b5c5

View File

@ -7,7 +7,7 @@ package time
import "errors"
// These are predefined layouts for use in Time.Format and Time.Parse.
// The reference time used in the layouts is:
// The reference time used in the layouts is the specific time:
// Mon Jan 2 15:04:05 MST 2006
// which is Unix time 1136239445. Since MST is GMT-0700,
// the reference time can be thought of as
@ -402,7 +402,7 @@ func (t Time) String() string {
// Format returns a textual representation of the time value formatted
// according to layout, which defines the format by showing how the reference
// time,
// time, defined to be
// Mon Jan 2 15:04:05 -0700 MST 2006
// would be displayed if it were the value; it serves as an example of the
// desired output. The same display rules will then be applied to the time
@ -676,6 +676,7 @@ func skip(value, prefix string) (string, error) {
// Parse parses a formatted string and returns the time value it represents.
// The layout defines the format by showing how the reference time,
// defined to be
// Mon Jan 2 15:04:05 -0700 MST 2006
// would be interpreted if it were the value; it serves as an example of
// the input format. The same interpretation will then be made to the