4 ms·
The problem with rendering TAI as UTC is you can't do it for future dates because you don't know how many leap seconds will have been added by then. For future
by globular-toast 5y ago
The problem with rendering TAI as UTC is you can't do it for future dates because you don't know how many leap seconds will have been added by then. For future dates you can either:
- store TAI: you'll always know how many SI seconds in the future it is, but you won't be able to accurately render UTC,
- store UTC timestamp: you'll always know what the time on the clock will be when the event happens, but you won't be able to accurately calculate how many seconds in the future it is.
The alternative is to ditch UTC. Make all wall clocks tick in SI seconds and render TAI dates in local time. This will always be correct. The only downside is you won't be able to accurately predict what position the Sun is in the sky when the event happens. But is this actually important?
- silon42 5y agoRendering future times as local time already has a problem where the timezone (DST) could potentially change.
- nly 5y agoThe real answer is you should store the timezone with the timestamp So you store "the meeting is at 10am London time". This will work, always...except for when you repeat an hour due to the DST shift but that's usually in the middle of the night on a Sunday
- globular-toast 5y agoAssuming London exists in the future ;) Yes... this way leads to madness. Time seems to be in a special class of problems that is easy to get wrong and hard to get right. I think we just have to aim for "least wrong" and try to keep our sanity intact.
- denton-scratch 5y agoAnother problem here is that DST is political, and under local political control. Politicians don't get why changes in timscales have to be announced well in advance; there have been cases where they were announced as little as a month before they came effect. Some commenters seem to wonder why people care about the relationships between timescales, and how to convert between them. Well, contracts seems to be a good example. It could be vitally important to know, to the second, when a 200-year-old contract came into force.
- techdragon 5y agoor… if you want the future time stamp to be “exactly x seconds” in the future you can store a tuple of the TAI time stamp of when you create the data point, and the SI seconds into the future from that time and then render it as appropriate for the audience’s level of understanding And if you want the future time stamp to be not actually a time stamp but a time of day on a calendar date, then you store a tuple of the TAI creation time, the UTC date you want it to be in the future Because you can never ever be sure of the future, by keeping the time you make the assumptions you can at least either calculate the correct answer or fix the data later when you find out something has changed. TAI is for timekeeping. UTC is for calendars.