Skip to content

Commit 4397d66

Browse files
rscdmitshur
authored andcommitted
[release-branch.go1.17] 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 <[email protected]> Run-TryBot: Russ Cox <[email protected]> Reviewed-by: Jay Conrod <[email protected]> Reviewed-by: Damien Neil <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-on: https://go-review.googlesource.com/c/go/+/341949 Trust: Dmitri Shuralyov <[email protected]> Run-TryBot: Dmitri Shuralyov <[email protected]> Reviewed-by: Russ Cox <[email protected]>
1 parent eb5a7b5 commit 4397d66

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

doc/go1.17.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -753,9 +753,9 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
753753

754754
<p><!-- CL 311572 -->
755755
The new
756-
<a href="/pkg/database/sql/#NullInt16"><code>NullInt16</code></a>
757-
and
758-
<a href="/pkg/database/sql/#NullByte"><code>NullByte</code></a>
756+
<a href="/pkg/database/sql/#NullInt16"><code>NullInt16</code></a>
757+
and
758+
<a href="/pkg/database/sql/#NullByte"><code>NullByte</code></a>
759759
structs represent the int16 and byte values that may be null. These can be used as
760760
destinations of the <a href="/pkg/database/sql/#Scan"><code>Scan</code></a> method,
761761
similar to NullString.
@@ -1205,11 +1205,11 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
12051205

12061206
<p><!-- CL 300996 -->
12071207
The package now accepts comma "," as a separator for fractional seconds when parsing and formatting time.
1208-
The following time formats are now accepted:
1208+
For example, the following time layouts are now accepted:
12091209
<ul>
1210-
<li>2006-01-02 14:06:03,999999999 -0700 MST</li>
1211-
<li>Mon Jan _2 14:06:03,120007 2006</li>
1212-
<li>Mon Jan 2 14:06:03,120007 2006</li>
1210+
<li>2006-01-02 15:04:05,999999999 -0700 MST</li>
1211+
<li>Mon Jan _2 15:04:05,000000 2006</li>
1212+
<li>Monday, January 2 15:04:05,000 2006</li>
12131213
</ul>
12141214
</p>
12151215

src/time/format.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ import "errors"
7777
// The formats and 002 are space-padded and zero-padded
7878
// three-character day of year; there is no unpadded day of year format.
7979
//
80-
// A decimal point followed by one or more zeros represents a fractional
81-
// second, printed to the given number of decimal places.
82-
// Either a comma or decimal point followed by one or more nines represents
80+
// A comma or decimal point followed by one or more zeros represents
81+
// a fractional second, printed to the given number of decimal places.
82+
// A comma or decimal point followed by one or more nines represents
8383
// a fractional second, printed to the given number of decimal places, with
8484
// trailing zeros removed.
8585
// For example "15:04:05,000" or "15:04:05.000" formats or parses with

0 commit comments

Comments
 (0)