You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best. https://play.golang.org/p/FH75X3kXgV
What did you expect to see?
dsecs=11643609600
What did you see instead?
dsecs=9223372036
correct results starts to appear after the year 1681. (and possibly few days/months before)
The text was updated successfully, but these errors were encountered:
As documented (see go doc time.Duration), a Duration overflows after 290 years, approximately. Thus this is working as documented. It's 2⁶³ nanoseconds:
mikioh
changed the title
Time.Sub bug when computing times before the year 1681
time: Time.Sub bug when computing times before the year 1681
Jan 5, 2018
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.9.2 darwin/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.9.2/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.9.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/36/_8j4j_hx70j84ydkhz_tdrfr0000gn/T/go-build255965845=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
https://play.golang.org/p/FH75X3kXgV
What did you expect to see?
dsecs=11643609600
What did you see instead?
dsecs=9223372036
correct results starts to appear after the year 1681. (and possibly few days/months before)
The text was updated successfully, but these errors were encountered: