News for hackers. Stuff that matters.
Re:Store your epoch times as 64-bit floats by ClumsyPilot on Friday June 09, 2023 @04:25PM (#36263684)
Use 128 bit integer in femptoseconds, with epoch being the begining of the universe. And it should be signed, because what if there was a previous universe.

Jokes aside, Unix Epoch shouls be replaced by Tai time on every computer.

https://en.m.wikipedia.org/wiki/International_Atomic_Time

Re:Store your epoch times as 64-bit floats by well_actulily on Friday June 09, 2023 @04:38PM (#36263846)
That gets us to ~5.392 * 10ˆ15 years after the Big Bang, which doesn't nearly get you to the heat death of the universe ~1.7 * 10ˆ106 years from now, but is probably good enough.
Re:Store your epoch times as 64-bit floats by jjoonathan on Friday June 09, 2023 @04:49PM (#36263986)
Black hole farmers hate this.
Re:Store your epoch times as 64-bit floats by mihaic on Friday June 09, 2023 @04:45PM (#36263945)
The person that pushed for the leap second should be flogged very hard!
Re:Store your epoch times as 64-bit floats by erik_seaberg on Friday June 09, 2023 @07:27PM (#36265735)
No, he might be into that.
Re:Store your epoch times as 64-bit floats by halosghost on Friday June 09, 2023 @05:11PM (#36264212)
If we're going to go this far, why not go all the way? [1]

I.e., use a 536-bit unsigned integer to store Planck time with one Planck time following the big bang as the epoch, and use the top three bits as a tetration height instead of an exponent, and you can get real far.

All the best,

[1] https://halosgho.st/blog/planck/

Re:Store your epoch times as 64-bit floats by cyann on Friday June 09, 2023 @05:22PM (#36264334)
At first glance I thought you were talking about "Thai" time, which is a surprising calendar when you have dates with years in the 2500 range. Looking at you Symantec AntiVirus, storing AV definitions date using the user's locale...

https://en.wikipedia.org/wiki/Buddhist_calendar

Re:Store your epoch times as 64-bit floats by Const-me on Sunday June 11, 2023 @05:09AM (#36279562)
The problem with Tai time, in offline systems it’s impossible to implement calendars on top. To translate Tai time to human-readable one, you gonna need a database of adjustments. We only have that data for very small interval of dates between 1972, and now()+6 months.

For the past, it’s possible to workaround by saying “no leap seconds” but this means that 12PM 1000 years ago might be any time of the day.

But that workaround not gonna work for the future. For many use cases it’s important to be able to represent date-time for many years in the future. The currently used formats allow that easily, at the price of these unpredictable leap second adjustments.