Leap second



A leap second is a one-second adjustment that is occasionally applied to Coordinated Universal Time (UTC), to accommodate the difference between precise time (International Atomic Time (TAI), as measured by atomic clocks) and imprecise observed solar time (UT1), which varies due to irregularities and long-term slowdown in the Earth's rotation. The UTC time standard, widely used for international timekeeping and as the reference for civil time in most countries, uses TAI and consequently would run ahead of observed solar time unless it is reset to UT1 as needed. The leap second facility exists to provide this adjustment. The leap second was introduced in 1972. Since then, 27 leap seconds have been added to UTC, with the most recent occurring on December 31, 2016. All have so far been positive leap seconds, adding a second to a UTC day; while it is possible for a negative leap second to be needed, one has not happened yet.

Because the Earth's rotational speed varies in response to climatic and geological events, UTC leap seconds are irregularly spaced and unpredictable. Insertion of each UTC leap second is usually decided about six months in advance by the International Earth Rotation and Reference Systems Service (IERS), to ensure that the difference between the UTC and UT1 readings will never exceed 0.9 seconds.

This practice has proven disruptive, particularly in the twenty-first century and especially in services that depend on precise timestamping or time-critical process control. And since not all computers are adjusted by leap-second, they will display times differing from those that have been adjusted. After many years of discussions by different standards bodies, in November 2022, at the 27th General Conference on Weights and Measures, it was decided to abandon the leap second by or before 2035.

History
In about AD 140, Ptolemy, the Alexandrian astronomer, sexagesimally subdivided both the mean solar day and the true solar day to at least six places after the sexagesimal point, and he used simple fractions of both the equinoctial hour and the seasonal hour, none of which resemble the modern second. Muslim scholars, including al-Biruni in 1000, subdivided the mean solar day into 24 equinoctial hours, each of which was subdivided sexagesimally, that is into the units of minute, second, third, fourth and fifth, creating the modern second as $1/60$ of $1/60$ of $1/24$ = $1/86,400$ of the mean solar day in the process. With this definition, the second was proposed in 1874 as the base unit of time in the CGS system of units. Soon afterwards Simon Newcomb and others discovered that Earth's rotation period varied irregularly, so in 1952, the International Astronomical Union (IAU) defined the second as a fraction of the sidereal year. In 1955, considering the tropical year to be more fundamental than the sidereal year, the IAU redefined the second as the fraction $1/31,556,925.975$ of the 1900.0 mean tropical year. In 1956, a slightly more precise value of $1/31,556,925.9747$ was adopted for the definition of the second by the International Committee for Weights and Measures, and in 1960 by the General Conference on Weights and Measures, becoming a part of the International System of Units (SI).

Eventually, this definition too was found to be inadequate for precise time measurements, so in 1967, the SI second was again redefined as 9,192,631,770 periods of the radiation emitted by a caesium-133 atom in the transition between the two hyperfine levels of its ground state. That value agreed to 1 part in 1010 with the astronomical (ephemeris) second then in use. It was also close to $1/86,400$ of the mean solar day as averaged between years 1750 and 1892.

However, for the past several centuries, the length of the mean solar day has been increasing by about 1.4–1.7 ms per century, depending on the averaging time. By 1961, the mean solar day was already a millisecond or two longer than $86,400$ SI seconds. Therefore, time standards that change the date after precisely $86,400$ SI seconds, such as the International Atomic Time (TAI), would become increasingly ahead of time standards tied to the mean solar day, such as Universal Time (UT).

When the Coordinated Universal Time (UTC) standard was instituted in 1960, based on atomic clocks, it was felt necessary to maintain agreement with UT, which, until then, had been the reference for broadcast time services. From 1960 to 1971, the rate of UTC atomic clocks was offset from a pure atomic time scale by the BIH to remain synchronized with UT2, a practice known as the "rubber second". The rate of UTC was decided at the start of each year, and was offset from the rate of atomic time by −150 parts per 10$10$ for 1960–1962, by −130 parts per 10$10$ for 1962–63, by −150 parts per 10$10$ again for 1964–65, and by −300 parts per 10$10$ for 1966–1971. Alongside the shift in rate, an occasional 0.1 s step (0.05 s before 1963) was needed. This predominantly frequency-shifted rate of UTC was broadcast by MSF, WWV, and CHU among other time stations. In 1966, the CCIR approved "stepped atomic time" (SAT), which adjusted atomic time with more frequent 0.2 s adjustments to keep it within 0.1 s of UT2, because it had no rate adjustments. SAT was broadcast by WWVB among other time stations.

In 1972, the leap-second system was introduced so that the UTC seconds could be set exactly equal to the standard SI second, while still maintaining the UTC time of day and changes of UTC date synchronized with those of UT1. By then, the UTC clock was already 10 seconds behind TAI, which had been synchronized with UT1 in 1958, but had been counting true SI seconds since then. After 1972, both clocks have been ticking in SI seconds, so the difference between their displays at any time is 10 seconds plus the total number of leap seconds that have been applied to UTC as of that time;, 27 leap seconds have been applied to UTC, so the difference is 10 + 27 = 37 seconds. The most recent leap second was on December 31, 2016.

Insertion of leap seconds
The scheduling of leap seconds was initially delegated to the Bureau International de l'Heure (BIH), but passed to the International Earth Rotation and Reference Systems Service (IERS) on 1 January 1988. IERS usually decides to apply a leap second whenever the difference between UTC and UT1 approaches 0.6 s, in order to keep the difference between UTC and UT1 from exceeding 0.9 s.

The UTC standard allows leap seconds to be applied at the end of any UTC month, with first preference to June and December and second preference to March and September. , all of them have been inserted at the end of either 30 June or 31 December. IERS publishes announcements every six months, whether leap seconds are to occur or not, in its "Bulletin C". Such announcements are typically published well in advance of each possible leap second date – usually in early January for 30 June and in early July for 31 December. Some time signal broadcasts give voice announcements of an impending leap second.

Between 1972 and 2020, a leap second has been inserted about every 21 months, on average. However, the spacing is quite irregular and apparently increasing: there were no leap seconds in the six-year interval between 1 January 1999 and 31 December 31, 2004 but there were nine leap seconds in the eight years 1972–1979. Since the introduction of leap seconds, 1972 has been the longest year on record: 366 days and two seconds.

Unlike leap days, which begin after 28 February, 23:59:59 local time, UTC leap seconds occur simultaneously worldwide; for example, the leap second on 31 December 2005, 23:59:60 UTC was 31 December 2005, 18:59:60 (6:59:60 p.m.) in U.S. Eastern Standard Time and 1 January 2006, 08:59:60 (a.m.) in Japan Standard Time.

Process
When it is mandated, a positive leap second is inserted between second 23:59:59 of a chosen UTC calendar date and second 00:00:00 of the following date. The definition of UTC states that the last day of December and June are preferred, with the last day of March or September as second preference, and the last day of any other month as third preference. All leap seconds (as of 2019) have been scheduled for either 30 June or 31 December. The extra second is displayed on UTC clocks as 23:59:60. On clocks that display local time tied to UTC, the leap second may be inserted at the end of some other hour (or half-hour or quarter-hour), depending on the local time zone. A negative leap second would suppress second 23:59:59 of the last day of a chosen month so that second 23:59:58 of that date would be followed immediately by second 00:00:00 of the following date. Since the introduction of leap seconds, the mean solar day has outpaced atomic time only for very brief periods and has not triggered a negative leap second.

Recent changes to the Earth's rotation rate have made it more likely that a negative leap second will be required before the abolition of leap seconds in 2035.

Slowing rotation of the Earth
Leap seconds are irregularly spaced because the Earth's rotation speed changes irregularly. Indeed, the Earth's rotation is quite unpredictable in the long term, which explains why leap seconds are announced only six months in advance.

A mathematical model of the variations in the length of the solar day was developed by F. R. Stephenson and L. V. Morrison, based on records of eclipses for the period 700 BC to 1623, telescopic observations of occultations for the period 1623 until 1967 and atomic clocks thereafter. The model shows a steady increase of the mean solar day by 1.70 ms (±0.05 ms) per century, plus a periodic shift of about 4 ms amplitude and period of about 1,500 yr. Over the last few centuries, rate of lengthening of the mean solar day has been about 1.4 ms per century, being the sum of the periodic component and the overall rate.

The main reason for the slowing down of the Earth's rotation is tidal friction, which alone would lengthen the day by 2.3 ms/century. Other contributing factors are the movement of the Earth's crust relative to its core, changes in mantle convection, and any other events or processes that cause a significant redistribution of mass. These processes change the Earth's moment of inertia, affecting the rate of rotation due to the conservation of angular momentum. Some of these redistributions increase Earth's rotational speed, shorten the solar day and oppose tidal friction. For example, glacial rebound shortens the solar day by 0.6 ms/century and the 2004 Indian Ocean earthquake is thought to have shortened it by 2.68 microseconds.

It is a mistake, however, to consider leap seconds as indicators of a slowing of Earth's rotation rate; they are indicators of the accumulated difference between atomic time and time measured by Earth rotation. The plot at the top of this section shows that in 1972 the average length of day was approximately $86,400.003$ seconds and in 2016 it was approximately $86,400.001$ seconds, indicating an overall increase in Earth's rotation rate over that time period. Positive leap seconds were inserted during that time because the annual average length of day remained greater than $86,400$ SI seconds, not because of any slowing of Earth's rotation rate.

In 2021, it was reported that Earth was spinning faster in 2020 and experienced the 28 shortest days since 1960, each of which lasted less than $86,399.999$ seconds. This caused engineers worldwide to discuss a negative leap second and other possible timekeeping measures, some of which could eliminate leap seconds.

Future of leap seconds
The TAI and UT1 time scales are precisely defined, the former by atomic clocks (and thus independent of Earth's rotation) and the latter by astronomical observations (that measure actual planetary rotation and thus the solar time at the Greenwich meridian). UTC (on which civil time is usually based) is a compromise, stepping with atomic seconds but periodically reset by a leap second to match UT1.

The irregularity and unpredictability of UTC leap seconds is problematic for several areas, especially computing (see below). With increasing requirements for timestamp accuracy in systems such as process automation and high-frequency trading, this raises a number of issues. Consequently, the long-standing practice of inserting leap seconds is under review by the relevant international standards body.

International proposals for elimination of leap seconds
On 5 July 2005, the Head of the Earth Orientation Center of the IERS sent a notice to IERS Bulletins C and D subscribers, soliciting comments on a U.S. proposal before the ITU-R Study Group 7's WP7-A to eliminate leap seconds from the UTC broadcast standard before 2008 (the ITU-R is responsible for the definition of UTC). It was expected to be considered in November 2005, but the discussion has since been postponed. Under the proposal, leap seconds would be technically replaced by leap hours as an attempt to satisfy the legal requirements of several ITU-R member nations that civil time be astronomically tied to the Sun.

A number of objections to the proposal have been raised. P. Kenneth Seidelmann, editor of the Explanatory Supplement to the Astronomical Almanac, wrote a letter lamenting the lack of consistent public information about the proposal and adequate justification. In an op-ed for Science News, Steve Allen of the University of California, Santa Cruz said that the process has a large impact on astronomers.

At the 2014 General Assembly of the International Union of Radio Scientists (URSI), Demetrios Matsakis, the United States Naval Observatory's Chief Scientist for Time Services, presented the reasoning in favor of the redefinition and rebuttals to the arguments made against it. He stressed the practical inability of software programmers to allow for the fact that leap seconds make time appear to go backwards, particularly when most of them do not even know that leap seconds exist. The possibility of leap seconds being a hazard to navigation was presented, as well as the observed effects on commerce.

The United States formulated its position on this matter based upon the advice of the National Telecommunications and Information Administration and the Federal Communications Commission (FCC), which solicited comments from the general public. This position is in favor of the redefinition.

In 2011, Chunhao Han of the Beijing Global Information Center of Application and Exploration said China had not decided what its vote would be in January 2012, but some Chinese scholars consider it important to maintain a link between civil and astronomical time due to Chinese tradition. The 2012 vote was ultimately deferred. At an ITU/BIPM-sponsored workshop on the leap second, Han expressed his personal view in favor of abolishing the leap second, and similar support for the redefinition was again expressed by Han, along with other Chinese timekeeping scientists, at the URSI General Assembly in 2014.

At a special session of the Asia-Pacific Telecommunity meeting on 10 February 2015, Chunhao Han indicated China was now supporting the elimination of future leap seconds, as were all the other presenting national representatives (from Australia, Japan, and the Republic of Korea). At this meeting, Bruce Warrington (NMI, Australia) and Tsukasa Iwama (NICT, Japan) indicated particular concern for the financial markets due to the leap second occurring in the middle of a workday in their part of the world. Subsequent to the CPM15-2 meeting in March/April 2015 the draft gives four methods which the WRC-15 might use to satisfy Resolution 653 from WRC-12.

Arguments against the proposal include the unknown expense of such a major change and the fact that universal time will no longer correspond to mean solar time. It is also answered that two timescales that do not follow leap seconds are already available, International Atomic Time ( TAI ) and Global Positioning System (GPS) time. Computers, for example, could use these and convert to UTC or local civil time as necessary for output. Inexpensive GPS timing receivers are readily available, and the satellite broadcasts include the necessary information to convert GPS time to UTC. It is also easy to convert GPS time to TAI, as TAI is always exactly 19 seconds ahead of GPS time. Examples of systems based on GPS time include the CDMA digital cellular systems IS-95 and CDMA2000. In general, computer systems use UTC and synchronize their clocks using Network Time Protocol (NTP). Systems that cannot tolerate disruptions caused by leap seconds can base their time on TAI and use Precision Time Protocol. However, the BIPM has pointed out that this proliferation of timescales leads to confusion.

At the 47th meeting of the Civil Global Positioning System Service Interface Committee in Fort Worth, Texas, in September 2007, it was announced that a mailed vote would go out on stopping leap seconds. The plan for the vote was: In January 2012, rather than decide yes or no per this plan, the ITU decided to postpone a decision on leap seconds to the World Radiocommunication Conference in November 2015. At this conference, it was again decided to continue using leap seconds, pending further study and consideration at the next conference in 2023.
 * April 2008: ITU Working Party 7A will submit to ITU Study Group 7 project recommendation on stopping leap seconds
 * During 2008, Study Group 7 will conduct a vote through mail among member states
 * October 2011: The ITU-R released its status paper, Status of Coordinated Universal Time (UTC) study in ITU-R, in preparation for the January 2012 meeting in Geneva; the paper reported that, to date, in response to the UN agency's 2010 and 2011 web-based surveys requesting input on the topic, it had received 16 responses from the 192 Member States with "13 being in favor of change, 3 being contrary."
 * January 2012: The ITU makes a decision.

In October 2014, Włodzimierz Lewandowski, chair of the timing subcommittee of the Civil GPS Interface Service Committee and a member of the ESA Navigation Program Board, presented a CGSIC-endorsed resolution to the ITU that supported the redefinition and described leap seconds as a "hazard to navigation".

Some of the objections to the proposed change have been addressed by its supporters. For example, Felicitas Arias, who, as Director of the International Bureau of Weights and Measures (BIPM)'s Time, Frequency, and Gravimetry Department, was responsible for generating UTC, noted in a press release that the drift of about one minute every 60–90 years could be compared to the 16-minute annual variation between true solar time and mean solar time, the one hour offset by use of daylight time, and the several-hours offset in certain geographically extra-large time zones.

Proposed alternatives to the leap second are the leap hour, which requires changes only once every few centuries; and the leap minute, with changes coming every half-century.

On 18 November 2022, the General Conference on Weights and Measures (CGPM) resolved to eliminate leap seconds by or before 2035. The difference between atomic and astronomical time will be allowed to grow to a larger value yet to be determined. A suggested possible future measure would be to let the discrepancy increase to a full minute, which would take 50 to 100 years, and then have the last minute of the day taking two minutes in a "kind of smear" with no discontinuity. The year 2035 for eliminating leap seconds was chosen considering Russia's request to extend the timeline to 2040, since, unlike the United States's global navigation satellite system, GPS, which does not adjust its time with leap seconds, Russia's system, GLONASS, does adjust its time with leap seconds.

ITU World Radiocommunication Conference 2023 (WRC-23), which was held in Dubai (United Arab Emirates) from 20 November to 15 December 2023 formally recognized the Resolution 4 of the 27th CGPM (2022) which decides that the maximum value for the difference (UT1-UTC) will be increased in, or before, 2035.

Calculation of time differences and sequence of events
To compute the elapsed time in seconds between two given UTC dates requires the consultation of a table of leap seconds, which needs to be updated whenever a new leap second is announced. Since leap seconds are known only 6 months in advance, time intervals for UTC dates further in the future cannot be computed.

Missing leap seconds announcement
Although BIPM announces a leap second 6 months in advance, most time distribution systems (SNTP, IRIG-B, PTP) announce leap seconds at most 12 hours in advance, sometimes only in the last minute and some even not at all (DNP3).

Implementation differences
Not all clocks implement leap seconds in the same manner. Leap seconds in Unix time are commonly implemented by repeating 23:59:59 or adding the time-stamp 23:59:60. Network Time Protocol (SNTP) freezes time during the leap second, some time servers declare "alarm condition". Other schemes smear time in the vicinity of a leap second, spreading out the second of change over a longer period. This aims to avoid any negative effects of a substantial (by modern standards) step in time. This approach has led to differences between systems, as leap smear is not standardized and several different schemes are used in practice.

Textual representation of the leap second
The textual representation of a leap second is defined by BIPM as "23:59:60". There are programs that are not familiar with this format and may report an error when dealing with such input.

Binary representation of the leap second
Most computer operating systems and most time distribution systems represent time with a binary counter indicating the number of seconds elapsed since an arbitrary epoch; for instance, since 1970-01-01 00:00:00 in POSIX machines or since 1900-01-01 00:00:00 in NTP. This counter does not count positive leap seconds, and has no indicator that a leap second has been inserted, therefore two seconds in sequence will have the same counter value. Some computer operating systems, in particular Linux, assign to the leap second the counter value of the preceding, 23:59:59 second (59–59–0 sequence), while other computers (and the IRIG-B time distribution) assign to the leap second the counter value of the next, 00:00:00 second (59–0–0 sequence). Since there is no standard governing this sequence, the timestamp of values sampled at exactly the same time can vary by one second. This may explain flaws in time-critical systems that rely on timestamped values.

Other reported software problems associated with the leap second
Several models of global navigation satellite receivers have software flaws associated with leap seconds:


 * Some older versions of Motorola Oncore VP, UT, GT, and M12 GPS receivers had a software bug that would cause a single timestamp to be off by a day if no leap second was scheduled for 256 weeks. On 28 November 2003, this happened. At midnight, the receivers with this firmware reported 29 November 2003, for one second and then reverted to 28 November 2003.
 * Older Trimble GPS receivers had a software flaw that would insert a leap second immediately after the GPS constellation started broadcasting the next leap second insertion time (some months in advance of the actual leap second), rather than waiting for the next leap second to happen. This left the receiver's time off by a second in the interim.
 * Older Datum Tymeserve 2100 GPS receivers and Symmetricom Tymeserve 2100 receivers apply a leap second as soon as the a leap second notification is received, instead of waiting for the correct date. The manufacturers no longer supports these models and no corrected software is available. A workaround has been described and tested, but if the GPS system rebroadcasts the announcement, or the unit is powered off, the problem will occur again.
 * Four different brands of navigational receivers that use data from BeiDou satellites were found to implement leap seconds one day early. This was traced to a bug related to how the BeiDou protocol numbers the days of the week.

Several software vendors have distributed software that has not properly functioned with the concept of leap seconds:


 * NTP specifies a flag to inform the receiver that a leap second is imminent. However, some NTP server implementations have failed to set their leap second flag correctly.  Some NTP servers have responded with the wrong time for up to a day after a leap second insertion.
 * A number of organizations reported problems caused by flawed software following the leap second that occurred on 30 June 2012. Among the sites which reported problems were Reddit (Apache Cassandra), Mozilla (Hadoop), Qantas, and various sites running Linux.
 * Despite the publicity given to the 2015 leap second, a small number of network failures occurred due to leap second-related software errors of some routers. Several older versions of the Cisco Systems Nexus 5000 Series Operating System NX-OS (versions 5.0, 5.1, 5.2) are affected by leap second bugs.

Some businesses and service providers have been impacted by leap-second related software bugs:


 * In 2015, interruptions occurred with Twitter, Instagram, Pinterest, Netflix, Amazon, and Apple's music streaming series Beats 1.
 * Leap second software bugs in Linux reportedly affected the Amadeus Altéa airlines reservation system, used by Qantas and Virgin Australia, in 2015.
 * Cloudflare was affected by a leap second software bug. Its DNS resolver implementation incorrectly calculated a negative number when subtracting two timestamps obtained from the Go programming language's function, which then used only a real-time clock source.  This could have been avoided by using a monotonic clock source, which has since been added to Go 1.9.
 * The Intercontinental Exchange, parent body to 7 clearing houses and 11 stock exchanges including the New York Stock Exchange, chose to cease operations for 61 minutes at the time of the 30 June 2015, leap second.

There were misplaced concerns that farming equipment using GPS navigation during harvests occurring on 31 December 2016, would be affected by the 2016 leap second. GPS navigation makes use of GPS time, which is not impacted by the leap second.

Due to a software error, the UTC time broadcast by the NavStar GPS system was incorrect by about 13 microseconds on 25–26 January 2016.

Workarounds for leap second problems
The most obvious workaround is to use the TAI scale for all operational purposes and convert to UTC for human-readable text. UTC can always be derived from TAI with a suitable table of leap seconds. The Society of Motion Picture and Television Engineers (SMPTE) video/audio industry standards body selected TAI for deriving timestamps of media. IEC/IEEE 60802 (Time sensitive networks) specifies TAI for all operations. Grid automation is planning to switch to TAI for global distribution of events in electrical grids. Bluetooth mesh networking also uses TAI.

Instead of inserting a leap second at the end of the day, Google servers implement a "leap smear", extending seconds slightly over a 24-hour period centered on the leap second. Amazon followed a similar, but slightly different, pattern for the introduction of the 30 June 2015, leap second, leading to another case of the proliferation of timescales. They later released an NTP service for EC2 instances which performs leap smearing. UTC-SLS was proposed as a version of UTC with linear leap smearing, but it never became standard.

It has been proposed that media clients using the Real-time Transport Protocol inhibit generation or use of NTP timestamps during the leap second and the second preceding it.

NIST has established a special NTP time server to deliver UT1 instead of UTC. Such a server would be particularly useful in the event the ITU resolution passes and leap seconds are no longer inserted. Those astronomical observatories and other users that require UT1 could run off UT1 – although in many cases these users already download UT1-UTC from the IERS, and apply corrections in software.