2 ms·
As far as I remember from earlier discussion, the reason that problems arise is that the posix standard defines a "day" as 86400 seconds, so leap seconds need t
by thaumasiotes 5y ago
As far as I remember from earlier discussion, the reason that problems arise is that the posix standard defines a "day" as 86400 seconds, so leap seconds need to be erased from history after they've happened. This doesn't make a lot of sense; on March 1st, we don't start pretending that February 29th never happened.
- zokier 5y agoWell, POSIX time is an additional layer of stupidity, but it certainly not the only source of problems; notably these GPS/GNSS related problems do not have anything to do with POSIX time
- account42 5y agoThere is no problem with GPS time, only with converting from GPS time to POSIX time or some other leap-second affected time.
- phicoh 5y agoThe problem is that posix needs the conversion between 'posix time' (seconds since 1970) and the split out year/month/day/hour/minute/second format to work for the future as well. Given that we don't know when there will be leap seconds in the future, this conversion is imposible if we want to take leap seconds into account. So the solution is to either ignore leap seconds (as posix currently does) or have a regular rate of leap seconds (just like leap years). Unfortunately, the rotation of the earth is are not regular enough for a fix rate. At the scale of a human life, leap seconds are completely irrelevant if you want to know the position of the sun. So it is bizar that our civil time has leap seconds. Looking back, that seems to be a historical mistake.
- thaumasiotes 5y ago> The problem is that posix needs the conversion between 'posix time' (seconds since 1970) and the split out year/month/day/hour/minute/second format to work for the future as well. > Given that we don't know when there will be leap seconds in the future, this conversion is impossible if we want to take leap seconds into account. The conversion is impossible anyway. We don't know what the calendar will look like in the future. That isn't a problem that can be solved by any means.
- phicoh 5y agoThat is different type of future. For a while leap seconds would come at a rate of around one leap second every 18 months. It is safe to say that the current calendar will be with us the next couple of years. Long term, who knows. But we would like to be able to do date calculations a couple of years into future.
- account42 5y agoTimezones and timezone offsets do change more frequently though, and sometimes withot any heads up. Being able to correctly format future dates is only possible for UTC, even with leap seconds.
- thaumasiotes 5y ago> Long term, who knows. But we would like to be able to do date calculations a couple of years into future. On the fairly safe assumption that you don't care about being off by a few seconds, leap seconds aren't a factor there. Assuming one leap second every month (!), your computed date two years out will be off by less than half a minute. No one will ever even notice; the entities that consume dates in calendar format -- people -- aren't capable of meeting time tolerances that tight. If you need to coordinate something down to the millisecond, calendar dates aren't for you.
- marcosdumay 5y agoThat's the point, if you need to coordinate things down to the millisecond, leap seconds are incredibly harmful, and if you don't, they are irrelevant.
- brandmeyer 5y ago> if you need to coordinate things down to the millisecond If this coordination needs to happen > 6 months in the future, then UTC is the wrong time standard to use. Use TAI.
- dhosek 5y ago>on March 1st, we don't start pretending that February 29th never happened. Speak for yourself.