-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
What version of Go are you using (go version)?
$ go version go version go1.18 darwin/amd64
Does this issue reproduce with the latest release?
Haven't tested.
What operating system and processor architecture are you using (go env)?
go env Output
$ go env GO111MODULE="auto" GOARCH="amd64" GOBIN="/Users/user/go/bin" GOCACHE="/Users/user/Library/Caches/go-build" GOENV="/Users/user/Library/Application Support/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/user/go/pkg/mod" GONOPROXY="github.com/company/*" GONOSUMDB="github.com/company/*" GOOS="darwin" GOPATH="/Users/user/go" GOPRIVATE="github.com/company/*" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/Cellar/go/1.18/libexec" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.18/libexec/pkg/tool/darwin_amd64" GOVCS="" GOVERSION="go1.18" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="" GOWORK="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/43/tj8j9j210w90_qk38fv70gs80000gp/T/go-build119987376=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
I ran this.
package main
import (
"fmt"
"math"
"time"
)
func main() {
updatedAt := time.Unix(math.MaxInt64, 0)
fmt.Println(updatedAt)
fmt.Println(time.Since(updatedAt))
updatedAt = time.Unix(922337203685477580, 0)
fmt.Println(time.Since(updatedAt))
}
What did you expect to see?
I expect to see the output of time.Since(maxInt64) as a negative value.
What did you see instead?
It returns a positive value.
292277026596-12-04 15:30:07 +0000 UTC
2562047h47m16.854775807s
-2562047h47m16.854775808s