We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go version
$ go version go version go1.12.4 linux/amd64
Not yet tested
go env
$ go env GOARCH="amd64" GOBIN="" GOCACHE="/home/nakama/.cache/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/nakama/go" GOPROXY="" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build340274852=/tmp/go-build -gno-record-gcc-switches"
package main import ( "fmt" "time" ) func main() { today := time.Now() future := time.Unix(2<<62 - 1, 0) fmt.Println(today, future) fmt.Println(today.Before(future)) }
2020-06-09 21:40:19.250234793 +0700 WIB m=+0.000164020 292277026596-12-04 22:30:07 +0700 WIB true
2020-06-09 21:40:19.250234793 +0700 WIB m=+0.000164020 292277026596-12-04 22:30:07 +0700 WIB false
The text was updated successfully, but these errors were encountered:
https://golang.org/pkg/time/#Unix
Not all sec values have a corresponding time value. One such value is 1<<63-1 (the largest int64 value).
Sorry, something went wrong.
What @seankhliao said. Note that 2<<62 == 1<<63. Closing here, since this is working as documented.
2<<62 == 1<<63
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Not yet tested
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: