Skip to content

Instantly share code, notes, and snippets.

@rkravchik
Created May 11, 2018 11:36
Show Gist options
  • Select an option

  • Save rkravchik/f81f8937fd84387e372b9de61b4df848 to your computer and use it in GitHub Desktop.

Select an option

Save rkravchik/f81f8937fd84387e372b9de61b4df848 to your computer and use it in GitHub Desktop.
Maximum time you can use.
// maxUnixTime is the maximum comparable time in go.
// See (spoiler: avoid to use math.MaxInt64):
// https://stackoverflow.com/questions/25065055/what-is-the-maximum-time-time-in-go
//
// Synonym to:
// time.Unix(1<<63-62135596801, 0).Unix()
// You can play with it here: https://play.golang.org/p/TaIAo84Wmq
const maxUnixTime = 1<<63 - 62135596801
var MaxTime = time.Unix(maxUnixTime, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment