1
0
mirror of https://github.com/golang/go synced 2024-11-26 23:01:23 -07:00

time: document how Parse handles two-digit years

Fixes #36549

Change-Id: Ia803330fc046d5807bbefd67acb419cb81640a13
GitHub-Last-Rev: bd35431908
GitHub-Pull-Request: golang/go#36584
Reviewed-on: https://go-review.googlesource.com/c/go/+/214980
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
Kirill Tatchihin 2020-01-23 16:14:40 +00:00 committed by Rob Pike
parent 39ea3d0a23
commit 8453844ed7

View 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