[ntp:questions] Re: How to handle leap second condition correctly?

David Woolley david at djwhome.demon.co.uk
Wed Jun 15 22:13:06 UTC 2005


In article <avova1p95kdfooh9ukr8iir2eevi9v4kga at 4ax.com>,
Friedel Jantzen <nospam_plz at freenet.de> wrote:

> Is the leap second flag bit in the server's reply set only during the
> leap second or on the whole day of the condition?

RFC 1305 Page 10:  The bits are set before 23:59 on the day of the
insertion and reset after 00:00 on the following day.... In the case
of primary servers, the bits are set by operator intervention, while in
the case of secondary servers the bits are set by the protocol. .....

Which means that they can be set for an extended period around the
leap second.  (I think this definition is unsafe, because poll intervals
are normally more than 60 seconds; they really need to be set at least
quite a few maximum poll intervals before the nominal leap second.)

> 2. Are the passed leap seconds of the last years to be counted in the
> timestamp, or is it correct to multiply simply (as I did)
> PassedDaysCount * SecondsPerDay ?

RFC 1305 Page 78:  Thus when a leap second is inserted in UTC and subsequently
in NTP, knowledge of all previous leap seconds is lost.

   Another was to describe this is to say there are as many NTP
timescales as historic leap seconds.  In effect, a new timescale is
established after each new leap second.  .....

So your simple multiplication is correct.



More information about the questions mailing list