3 ms·
> The reason a positive leap second was such a problem was because it add an "invalid entry", ie. 23:59:60. It's only a problem if you have a hardcoded assump
by chungy 6y ago
> The reason a positive leap second was such a problem was because it add an "invalid entry", ie. 23:59:60.
It's only a problem if you have a hardcoded assumption that all minutes have exactly 60 seconds. You'll encounter the same problem if 23:59:58 is followed by 00:00:00
Computers don't usually count time in this manner and the display is converted via mathematical formula. It'd just have to be adjusted to account for leap seconds, positive or negative.
- deleted 6y ago[deleted]
- Thiez 6y ago> You'll encounter the same problem if 23:59:58 is followed by 00:00:00 On the contrary, I would expect skipping a second to happen all the time from the perspective of userland programs, due to common things such as blocking system calls and program scheduling under load. Also features such as sleep and hibernate can easily skip entire days.
- zizee 6y agoThat's not really the type of "skipping" that is the issue. Software tends to ask the system the current time (via a library), and the system responds with a "here is a number, it is the number of [units] since [epoch]". The library then converts that number using a formula to work out a date/time. If it is decided a leap second is added or subtracted, and the library's formula doesn't account for it, then the time will be calculated incorrectly. For most software it is unlikely to matter too much, but this sort of thing can lead to unpredictable emergent behavior in complex networked systems.