diff --git a/src/time/format.go b/src/time/format.go index b15101e160..873d3ffde9 100644 --- a/src/time/format.go +++ b/src/time/format.go @@ -39,6 +39,9 @@ import "errors" // offset for the UTC zone. Thus: // Z0700 Z or ±hhmm // Z07:00 Z or ±hh:mm +// +// The executable example for time.Format demonstrates the working +// of the layout string in detail and is a good reference. const ( ANSIC = "Mon Jan _2 15:04:05 2006" UnixDate = "Mon Jan _2 15:04:05 MST 2006" @@ -405,6 +408,11 @@ func (t Time) String() string { // 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 // value. +// +// A fractional second is represented by adding a period and zeros +// to the end of the seconds section of layout string, as in "15:04:05.000" +// to format a time stamp with millisecond precision. +// // Predefined layouts ANSIC, UnixDate, RFC3339 and others describe standard // and convenient representations of the reference time. For more information // about the formats and the definition of the reference time, see the @@ -671,7 +679,7 @@ func skip(value, prefix string) (string, error) { // and convenient representations of the reference time. For more information // about the formats and the definition of the reference time, see the // documentation for ANSIC and the other constants defined by this package. -// Also, the executable Example for time.Format demonstrates the working +// Also, the executable example for time.Format demonstrates the working // of the layout string in detail and is a good reference. // // Elements omitted from the value are assumed to be zero or, when