![]() It's implemented as a clock running at a fixed integral offset to CLOCK_REALTIME, which is atomically incremented by 1 when the CLOCK_REALTIME clock is stepped back on leap second. timestamps collected in the ambiguous second cannot be sorted correctly without additional information.įor applications where it would be possible to work with TAI time instead of UTC, the kernel provides a special CLOCK_TAI clock which does include leap seconds and doesn't need to be corrected after leap second, avoiding the problem with backward jump in the time entirely. But when real time is really needed, there are problems that are difficult to fix, e.g. In some cases it's a bug that could be fixed by using the CLOCK_MONOTONIC clock instead of CLOCK_REALTIME. The following graph shows how will the offset to TAI of a system clock keeping time in UTC and synchronized by ntpd or chronyd in default configuration change on 30 June 2015.įor some applications the backward jump can be a major problem. The outcome is that the clock is off by one second for one second. The clock repeats most of the 23:59:59 second and also a small part from the beginning of the 00:00:00 second. The backward jump doesn't happen exactly at 00:00:00, but rather on the first system clock update in that second. This is implemented in the Linux kernel and it is enabled by default when the clock is synchronized with NTP servers by the ntpd or chronyd daemon from the reference or chrony NTP implementations respectively. The most common approach is to simply step the clock back by one second when the clock gets to 00:00:00 UTC. There are several ways how the clock can be corrected. When a leap second is inserted to UTC, the system clock skips that second as it can't be represented and is suddenly ahead of UTC by one second. Otherwise with every inserted leap second any future dates after the leap second with a fixed time of the day would have to be shifted by one second ahead. Also, the applications would need to use a different representation to store future dates with a given time of day as leap seconds are scheduled only few months ahead. from the right directory in the tzdata package) to break the current time in applications to the correct date and the time of the day using only standard libc functions, there are too many applications that rely on the current definition, expecting that every day has 86400 seconds. While technically it wouldn't be very difficult to modify an NTP implementation to keep the system time in a representation which does include leap seconds and use for instance special time zones (e.g. Ordinary computer clocks are not stable enough to keep time on their own so accurate than an extra second added every year or two would matter, but when a clock is synchronized with NTP servers with millisecond accuracy, the inability of the clock to go through an inserted leap second is a real issue. The system clock cannot have time 23:59:60, every minute has 60 seconds and every day has 86400 seconds by definition. It's defined as number of seconds since 00:00:00 UTC on 1 January 1970, but without leap seconds. That is the time which is kept by the CLOCK_REALTIME system clock and used by almost every application which needs to know the current time. ![]() The trouble with leap seconds on computers is that there is no room for them in the standard Unix time. The current plan is that the International Telecommunication Union (ITU) will decide at the World Radiocommunication Conference in November 2015. A discussion about this topic has been going on for a long time, but so far no agreement has been reached. There is a possibility that leap seconds will be abolished in the future. Leap seconds are scheduled only about 6 months in advance. The next one is scheduled for 30 June 2015, when the offset from TAI will increase to 36 seconds. The first leap second was inserted in 1972 and 25 seconds were inserted so far. UTC is based on the International Atomic Time (TAI) and it is currently 35 seconds behind TAI. The mean solar day is about 2 milliseconds longer than 24 hours and in long term it's getting longer as the Moon is constantly slowing down the Earth's rotation. The concept is similar to that of leap day, but instead of adding a 29th day to February to keep the calendar synchronized with Earth's orbit around the Sun, an extra second 23:59:60 is added to the last day of June or December to keep the time of the day synchronized with the Earth's rotation relative to the Sun. A leap second is an adjustment that is once in a while applied to the Coordinated Universal Time (UTC) to keep it close to the mean solar time.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |