From: Russ Cox Date: Fri, 6 Aug 2021 17:21:25 +0000 (-0400) Subject: time: fix docs for new comma layouts X-Git-Tag: go1.18beta1~1819 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=044ec4fa9818d785e2b0d4064514abcf4f252fcb;p=gostls13.git time: fix docs for new comma layouts The current text is slightly inaccurate. Make it more correct. Change-Id: Iebe0051b74649d13982d7eefe3697f9e69c9b75d Reviewed-on: https://go-review.googlesource.com/c/go/+/340449 Trust: Russ Cox Run-TryBot: Russ Cox Reviewed-by: Jay Conrod Reviewed-by: Damien Neil Reviewed-by: Ian Lance Taylor TryBot-Result: Go Bot --- diff --git a/doc/go1.17.html b/doc/go1.17.html index b65d13a040..c1b5ab3f6f 100644 --- a/doc/go1.17.html +++ b/doc/go1.17.html @@ -753,9 +753,9 @@ func Foo() bool {

The new - NullInt16 - and - NullByte + NullInt16 + and + NullByte structs represent the int16 and byte values that may be null. These can be used as destinations of the Scan method, similar to NullString. @@ -1205,11 +1205,11 @@ func Foo() bool {

The package now accepts comma "," as a separator for fractional seconds when parsing and formatting time. - The following time formats are now accepted: + For example, the following time layouts are now accepted:

    -
  • 2006-01-02 14:06:03,999999999 -0700 MST
  • -
  • Mon Jan _2 14:06:03,120007 2006
  • -
  • Mon Jan 2 14:06:03,120007 2006
  • +
  • 2006-01-02 15:04:05,999999999 -0700 MST
  • +
  • Mon Jan _2 15:04:05,000000 2006
  • +
  • Monday, January 2 15:04:05,000 2006

diff --git a/src/time/format.go b/src/time/format.go index bb173a21c2..f4b4f48142 100644 --- a/src/time/format.go +++ b/src/time/format.go @@ -77,9 +77,9 @@ import "errors" // The formats and 002 are space-padded and zero-padded // three-character day of year; there is no unpadded day of year format. // -// A decimal point followed by one or more zeros represents a fractional -// second, printed to the given number of decimal places. -// Either a comma or decimal point followed by one or more nines represents +// A comma or decimal point followed by one or more zeros represents +// a fractional second, printed to the given number of decimal places. +// A comma or decimal point followed by one or more nines represents // a fractional second, printed to the given number of decimal places, with // trailing zeros removed. // For example "15:04:05,000" or "15:04:05.000" formats or parses with