]> Cypherpunks repositories - gostls13.git/commitdiff
time: document how Parse handles two-digit years
authorKirill Tatchihin <kirabsuir@gmail.com>
Thu, 23 Jan 2020 16:14:40 +0000 (16:14 +0000)
committerRob Pike <r@golang.org>
Thu, 23 Jan 2020 20:44:44 +0000 (20:44 +0000)
Fixes #36549

Change-Id: Ia803330fc046d5807bbefd67acb419cb81640a13
GitHub-Last-Rev: bd354319083bf80c250e1915f2be6860d2f7d14b
GitHub-Pull-Request: golang/go#36584
Reviewed-on: https://go-review.googlesource.com/c/go/+/214980
Reviewed-by: Rob Pike <r@golang.org>
src/time/format.go

index b531cb47604f04a83399d8cbd22e96c8126af140..9beb5d9a48fcbbd4d3f8c1f9f0021e207e38bb11 100644 (file)
@@ -792,6 +792,9 @@ func skip(value, prefix string) (string, error) {
 // Years must be in the range 0000..9999. The day of the week is checked
 // for syntax but it is otherwise ignored.
 //
+// For layouts specifying the two-digit year 06, a value NN >= 69 will be treated
+// as 19NN and a value NN < 69 will be treated as 20NN.
+//
 // In the absence of a time zone indicator, Parse returns a time in UTC.
 //
 // When parsing a time with a zone offset like -0700, if the offset corresponds