4 ms·
OP here. I really wish this hadn't been submitted, but it's here so I might as well... > Most notably, you would not be able to reliably construct dates in the
by Udo 13y ago
OP here. I really wish this hadn't been submitted, but it's here so I might as well...
> Most notably, you would not be able to reliably construct dates in the future
You already need libraries for these functions. The only difference is that right now, those libraries have to calculate against a moving target instead of one that behaves predictably. I wrote this post a long time ago to suggest a strict(er) divide between computer timestamps and human timestamps, because Unix timestamps are in effect neither.
There are countless apps that implicitly assume timestamps are linearly counted upwards. Most people would say those are bugs, but they'd only be right on superficial grounds. What most applications rightly want is a monotonic, predictable way to count the passing of time and to exchange that data with other apps.
My idea was to introduce such a linear counter for apps that want it, not (as some people here obtusely suggested) replacing the Unix timestamp with this no matter the ecosystem breakage.
- haberman 13y ago> You already need libraries for these functions. I'm not sure if you caught my point. Library or no, it is impossible to construct future dates because it is unknown when leap seconds will be inserted until six months or so before it happens. Leap seconds are based on minute changes in the rotation of the earth, which are unpredictable. I added this to my comment later, but I think a better way to get a strictly monotonic timestamp is to smear the leap second: http://googleblog.blogspot.com/2011/09/time-technology-and-leaping-seconds.html http://googleblog.blogspot.com/2011/09/time-technology-and-l... > There are countless apps that implicitly assume timestamps are linearly counted upwards. There are also countless apps that implicitly assume that minutes are 60 seconds, hours are 3600 seconds, days are 86,400 seconds. Your scheme would break these apps.
- Udo 13y agoI think we're misunderstanding each other. > Library or no, it is impossible to construct future dates because it is unknown > when leap seconds will be inserted until six months or so before it happens. This problem exists whether the Unix timestamp actually jumps or not. At some point, a reference table will have to be updated with the most current leap second data - otherwise you couldn't accurately count seconds between to points in time anyway. If that much precision is actually needed is another thing entirely. Again, the idea is just to make a cleaner separation between the two worlds. > Your scheme would break these apps. Again, and I already said this multiple times now, the idea is not to abolish the Unix timestamp and ignore whatever breaks. Instead I suggested to introduce a linear counter for apps that want it. I might be wrong of course, but I believe using this monotonic counter instead would greatly reduce complexity and potential for bugs in many applications.
- haberman 13y ago> This problem exists whether the Unix timestamp actually jumps or not. No it doesn't. I can tell you authoritatively that the UNIX timestamp for 2023-01-01 00:00 UTC is 1672560000. That value is not dependent on future changes to the rotation of the Earth. Now it is true that I cannot tell you precisely how many physical seconds there are between now and then, because I do not know how many leap seconds will be added in the meantime. But in practice I think this is less critical. Applications that care about this probably use a more specialized time scale anyway. But it would be strange to put an appointment in your calendar for midnight and find that later on it had flipped to being at 11:59pm the previous day. > Again, and I already said this multiple times now, the idea is not to abolish the Unix timestamp and ignore whatever breaks. Instead I suggested to introduce a linear counter for apps that want it. I understand what you are saying. I'm just saying that your proposal trades one surprise for another. An app author might think "oh yes, a monotonic time sounds nice" and start using it, only to find that they are broken later because they were surprised that a minute could be 61 seconds long.
- __david__ 13y ago> I can tell you authoritatively that the UNIX timestamp for 2023-01-01 00:00 UTC is 1672560000. That assumes the calendar definition does not change. What if a 10 month calendar with a new year that starts in spring somehow becomes widely popular and adopted as the standard sometime in the next 10 years? Then suddenly 2023-01-01 is not 1672560000 and is actually 1680332400.
- haberman 13y agoUTC is defined in terms of days. UTC calendar dates are presumed to use the Gregorian calendar. 2023-01-01 in the Gregorian calendar maps to a specific day (Julian day 2459946). If you wanted to use a different calendar, you would need to map it to Julian days also to convert between the two. The idea that the world would suddenly change to a new calendar is highly unlikely, and if it did happen it is not at all clear what the correct behavior would be for future dates that had been specified before the switch.