Commit fb1fd6ae authored by Ian Lance Taylor's avatar Ian Lance Taylor

time: improve comments about valid layouts being invalid Parse values

Updates #9346
Updates #22135

Change-Id: I7039c9f7d49600e877e35b7255c341fea35890e2
Reviewed-on: https://go-review.googlesource.com/74890Reviewed-by: default avatarRob Pike <r@golang.org>
parent 6eb80769
...@@ -317,8 +317,8 @@ func ExampleParse() { ...@@ -317,8 +317,8 @@ func ExampleParse() {
t, _ = time.Parse(shortForm, "2013-Feb-03") t, _ = time.Parse(shortForm, "2013-Feb-03")
fmt.Println(t) fmt.Println(t)
// Valid layouts may not be a valid time value, due to format specifiers // Some valid layouts are invalid time values, due to format specifiers
// like _ for zero padding or Z for zone information. // such as _ for zero padding and Z for zone information.
// For example the RFC3339 layout 2006-01-02T15:04:05Z07:00 // For example the RFC3339 layout 2006-01-02T15:04:05Z07:00
// contains both Z and a time zone offset in order to handle both valid options: // contains both Z and a time zone offset in order to handle both valid options:
// 2006-01-02T15:04:05Z // 2006-01-02T15:04:05Z
......
...@@ -18,8 +18,8 @@ import "errors" ...@@ -18,8 +18,8 @@ import "errors"
// reference time looks like so that the Format and Parse methods can apply // reference time looks like so that the Format and Parse methods can apply
// the same transformation to a general time value. // the same transformation to a general time value.
// //
// Valid layouts may not be a valid time value for time.Parse, due to formats // Some valid layouts are invalid time values for time.Parse, due to formats
// like _ for zero padding or Z for zone information. // such as _ for zero padding and Z for zone information.
// //
// Within the format string, an underscore _ represents a space that may be // Within the format string, an underscore _ represents a space that may be
// replaced by a digit if the following number (a day) has two digits; for // replaced by a digit if the following number (a day) has two digits; for
......
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