From d3fb02b5c5850f53721d923be6770246aca7f69e Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Mon, 28 Jul 2014 17:24:39 -0700 Subject: [PATCH] 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 --- src/pkg/time/format.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pkg/time/format.go b/src/pkg/time/format.go index 5f732d8ecf4..14b1250cb0c 100644 --- a/src/pkg/time/format.go +++ b/src/pkg/time/format.go @@ -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