NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: date(1) doesn't handle leap-seconds?



On Sun, 2 Nov 2008 15:11:55 -0500
Jan Schaumann <jschauma%netmeister.org@localhost> wrote:

> Paul Goyette <paul%whooppee.com@localhost> wrote:
> 
> > Ah, OK.  So POSIX syystems are all currently off by 23 seconds, and
> > soon to be off by 24 seconds (there's another leapsecond coming up
> > at the end of 2008).  Bummer.
> 
> That is not quite my understanding.  ntpd can slew the system time to
> ensure it's in sync without actually adding seconds, ie seconds can
> get stretched.  This leaves the number of seconds since the epoch
> still at monotonically increasing, they're just not all of the same
> length.

Well, ntpd can do that, but it does it to make your system read the
same number of <seconds,picoseconds> since the epoch as every other
system.  Conversion to display format -- i.e., yyyy-mm-dd
hh:mm:ss.sssss -- is very much up to the local application.  In other
words, that's where the leap second stuff goes; ntpd only stretches or
shrinks seconds locally to bring you into sync with the world.
> 
> Also, some systems choose to interpret the epoch number by displaying
> 23:59:59 or 00:00:00 for two seceonds.
> 
> -Jan



                --Steve Bellovin, http://www.cs.columbia.edu/~smb


Home | Main Index | Thread Index | Old Index