Re:Let’s Stop the Unix Time Insanity
by magila on Monday December 02, 2013 @07:12PM
(#6837597)
You can't know what the UNIX timestamp for Jan 1, 2023 00:00:00 is either. Is DST going to be in effect? What if the relevant governing body decides to change the offset of the time zone you are in?
[ Parent
| on HN ]
Good point, as it pertains to local time. You can authoritatively say the answer for UTC though.
No you can't, because leap seconds affect UTC as well. We don't know how many leap seconds are going to be added or subtracted between now and then.
It does not matter, because leap seconds do not affect the UNIX timestamp <-> UTC mapping. That is the whole point of what I am saying.
The UNIX timestamp for 2023-01-01 00:00 UTC is 1672560000. I can tell you that right now even though I do not know how many leap seconds will be added between now and then.
Huh. I didn't know that the UNIX timestamp essentially gets recalculated at UTC midnight every day to ensure that midnight now = midnight yesterday + 86400. I take back my previous argument.
But what does that really buy you? We already have to store such dates using a datetime struct to handle the common case where the user wants to deal in local time. In what context could you not handle UTC the same way as local time?