[ntp:questions] Leap Second

Bill Unruh unruh at physics.ubc.ca
Tue Dec 2 23:30:43 UTC 2008


Unruh <unruh-spam at physics.ubc.ca> writes:

>michael.froment at gmail.com writes:

>>Hi all,
>>Since yesterday I saw the leap second Flag set on some servers of
>>ntp.pool.org. I'am quite surprise because the leap second add to be
>>set the 31/12/2008 and not the 1/12/2008.
>>Is it normal????

>The leap is announced at the beginning of the month to make sure that all
>ntp clients know about it. It always occurs at the end of the month ( I
>think ntpd has it hard coded as the end of June or Dec, but in principle it
>could be any month)

Here is a fragment from the ntp code (ntp_loopfilter.c) (4.2.4p4)

if ((tm->tm_mon + 1 == 6 &&
                tm->tm_mday == 30) || (tm->tm_mon +
                1 == 12 && tm->tm_mday == 31)) {
               if (leap_next & LEAP_ADDSECOND)
                  ntv.status |= STA_INS;
               else if (leap_next &
                   LEAP_DELSECOND)
                  ntv.status |= STA_DEL;

Ie, ntp pays attention to the leap second flag only if it is June 30 or Dec
31. Now, that is not correct since I believe that a leapsecond can occur on
any month, but the tradition is that if there is only one or two a year,
those are the dates chosen. In a century or two, when there are more than 2
per year, then ntpd will run into trouble. (Of course the definition of
time might have changed anyway, or the whole UTC kludge may be scrapped or
a new edition of ntpd not containing that assumption may be published.)
Note that the very existence of ntpd with its assumptions puts huge
pressure on the standards organisation to comply with the assumptions. 




More information about the questions mailing list