leap seconds

In Risks 24.80 David E. Ross wrote:

The elimination of leap-seconds is being promoted by those who are too lazy or too incompetent to code time conversions correctly. This situation arose because the long-term slowing of the earth's rotation (which creates the need for leap-seconds) failed to occur for several years, eliminating the need for leap-seconds for 7 years. Previously, a leap-second had been required every year or two.

From 1 January 1961 until 1 January 1972, UTC seconds varied in length relative to TAI seconds, leap-seconds were fractions of a second, and UTC clocks thus did not tick on the same instant as TAI clocks. I was a software test engineer on a project that handled this correctly.

UTC was redefined starting 1 January 1972 to have a second exactly the same as the TAI second, to have leap-seconds exactly whole seconds, and thus UTC clocks thereafter indeed did tick on the exact same instant as TAI clocks. The old software did not need revision; it still handled this correctly.

This was for a large software system for the command and control of military space satellites. Internal time was kept in TAI minutes from some base time because the mathematics required all minutes to be uniform in duration. External time, however, was reported in UTC (day, month, year, hour, minute, and seconds -- to the nearest millisecond). UTC was also used as an intermediate step to getting actual solar time (not mean solar time) for determining the orientation of the surface of the earth relative to a fixed coordinate system based on the stars.

When the software system was replaced in the mid-1980s, the developer (who had not worked on the previous system) did not really understand the difference between UTC and TAI. I repeatedly -- and unsuccessfully -- warned both the developer and the US Air Force (the customer) that there would be problems for not doing time conversions correctly. In the end, the Air Force was required to suspend mission operations a minute before a leap-second and resume operations a minute after. This suspension was considered to be a cost-effective response to the lack of proper design because correcting the design would impact both software and hardware with a cost of several millions of dollars (partially a consequence of poor modularization of the software). A capability that existed in 1970 no longer existed in 1992.

Rob Seaman wrote:

The first leap hour is estimated to occur in about 600 years. They accelerate quadratically after that - remember, we have leap seconds due to the tidal slowing that has already occurred. Future slowing will make leap seconds occur more frequently. There have been the equivalent of about 4 leap hours since Aristotle's time.


Tags: , ,

9 Responses:

  1. This is the kind of thing that makes me want to smack programmers.

    But I also kinda like the idea of the entire US Air Force, all over the world, simultaneously twiddling their thumbs for 121 seconds.

  2. fgmr says:

    Does this qualify for a CADT tag?

  3. wisedonkey says:

    The computer industry is regressing. Other than speed improvements and gloss, we're actually worse off than we were 20 years ago.

  4. zoratu says:

    The "Torino" meeting sparked my curiosity about the whole thing. Steve Allen, a tech at the UCO/Lick Observatory, has a really good page with lots of info and links for the terminally curious.

  5. boyofish says:

    I presented a talk at a local group of professional astronomers about this subject, as the American Astronomical Society was soliciting comments from the professional astronomical community last year. The committee that currently defines the leap second is, very quietly, trying to push the leap hour concept through.

    What amazed me about this whole business is that although the earth's orbital position can be accurately projected back in time many millions of years, you cannot do the same for the angular rotation rate of the earth, and it is this typically decadal random walk variation that causes the need for leap seconds - the tidal slowing of the moon is a very slow long term trend superimposed on this larger short term variation. The leap seconds cannot be predicted beyond the next few years, and so you need your software to have a look up table to take account of the difference between UTC and UT1.

    So - did you know that it's perfectly valid for the current time definition to *remove* leap seconds? Since 1972 the deceleration of the Earth's angular rotation speed has been fairly large, but it looks if that trend is reversing - we may have to remove a leap second in the next decade or so.

    Leap hours? Rubbish!