]> Cypherpunks repositories - gostls13.git/commitdiff
time: make it clearer that the reference time is the reference time.
authorRob Pike <r@golang.org>
Tue, 29 Jul 2014 00:24:39 +0000 (17:24 -0700)
committerRob Pike <r@golang.org>
Tue, 29 Jul 2014 00:24:39 +0000 (17:24 -0700)
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

index 5f732d8ecf4205582b816c01ff0bb9bf8acb302e..14b1250cb0c2b45b22e388c918b93c05cbb901c3 100644 (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