]> Cypherpunks repositories - gostls13.git/commit
time: add a sentence about distant times to time.Time.Unix
authorRob Pike <r@golang.org>
Thu, 9 Jan 2020 05:22:31 +0000 (16:22 +1100)
committerRob Pike <r@golang.org>
Mon, 13 Jan 2020 21:56:50 +0000 (21:56 +0000)
commit4ead7e8cc4fd5c09db7aba5c4f5fd5d957c82a24
treedd6288009cefb0830b8ebf9f0f520cd4065b7e4d
parent9ead772a921f0792db5630a3485a95c5a10c85df
time: add a sentence about distant times to time.Time.Unix

Since Durations only span 290 years, they are not good for
manipulating very remote times. I bounced off this problem recently
while doing some astronomical calculations and it took me a while to
realize I could get a 64-bit seconds value from time.Time.Unix and
subtract two of them to evaluate the interval.

I thought it worth adding a sentence to make this clear. It didn't
occur to me for quite a while that "Unix time" spans a huge range in
the Go library.

Change-Id: I76c75dc951dfd6bcf86e8b0be3cfec518a3ecdee
Reviewed-on: https://go-review.googlesource.com/c/go/+/213977
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
src/time/time.go