]> Cypherpunks repositories - gostls13.git/commitdiff
time: add note about Parse()'s choice of default year
authorShenghou Ma <minux.ma@gmail.com>
Fri, 18 Jan 2013 20:57:31 +0000 (04:57 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Fri, 18 Jan 2013 20:57:31 +0000 (04:57 +0800)
R=rsc
CC=golang-dev
https://golang.org/cl/7101046

src/pkg/time/format.go

index 417e8f8d7a80a7f5ead3158fe9c8f2035d1d98bb..35118a9ff76b7fedfb32ceb46875059542ed5991 100644 (file)
@@ -637,7 +637,8 @@ func skip(value, prefix string) (string, error) {
 //
 // Elements omitted from the value are assumed to be zero or, when
 // zero is impossible, one, so parsing "3:04pm" returns the time
-// corresponding to Jan 1, year 0, 15:04:00 UTC.
+// corresponding to Jan 1, year 0, 15:04:00 UTC (note that because the year is
+// 0, this time is before the zero Time).
 // Years must be in the range 0000..9999. The day of the week is checked
 // for syntax but it is otherwise ignored.
 func Parse(layout, value string) (Time, error) {