Created
May 11, 2018 11:36
-
-
Save rkravchik/f81f8937fd84387e372b9de61b4df848 to your computer and use it in GitHub Desktop.
Maximum time you can use.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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