[NTLUG:Discuss] Slightly OT: Why would I care about Leap Seconds

Kipton Moravec kip at kdream.com
Sun Feb 4 22:01:01 CST 2007


Leap seconds are added on December 31, at 11:59:59 p.m. and you see a
11:59:60 for 1 second before January 1, 12:00:00 a.m. This is to take
into account the number of seconds in a year based on the atomic clocks,
and the actual rotation of the earth. They are close and I think there
was a leap second this past year, and probably will not be a leap second
at the end of this year.

You do not have to care unless you are worried about keeping very
accurate time. 

There are two sources of time that are generally available. The Atomic
Clocks in Colorado are used to put out the time every second.
http://en.wikipedia.org/wiki/Atomic_clock   The data will actually show
23:59:60 on a leap second year. These signals are broadcast on WWV,
WWVH, and WWVB http://tf.nist.gov/stations/wwv.html The relative cheap
"Atomic Clocks" you can purchase that never need to be reset listen for
this signal and reset themselves. The chips are only a couple of dollars
if you can find them. These clocks are the basis of NIST time standard
for the United States. 

The over-kill and more popular method now is to use GPS. However GPS
time does not take into account leap seconds, so it is currently about
17 seconds different than the "Real" time. When they discovered the
problem it was too difficult to do leap seconds in the tracking and
orbit calculations, so they fixed the problem by having a separate field
with the leap seconds adjustment. So the GPS receiver will report the
correct time (GPS Time + leap second offset) to you and you will not
notice a problem until about 100 years when the leap second field
overflows and all hell breaks loose. (Something like the Y2K problem.)
But there will probably be something different than GPS by then anyway,
so nobody seems to care about it. GPS receivers often provide a 1 second
HW pulse with an accuracy of 1 microsecond. 

In theory, the NIST atomic clocks are also the basis for Internet time.
In practice, some of the secondary time servers have been found to be
off, so some companies that require accurate time, purchase expensive
($1K-2K) accurate time servers that calibrate themselves using GPS.

The typical crystal used in a microcontroller has an accuracy of 6 ppm.
So over a year that error could be as much as 18-19 seconds. 

I do not know what the accuracy of the clock in a PC is but it is much
worse than that. I think I have seen a minute per week. The PC clock is
something between 16 and 17 Hz (16.6666... Hz or something like that.)

It all depends on how accurate you are required to be. Some systems have
problems when they get time stamped info from a time in the future, or
if the system clock jumps backwards. (You can't extend that 30 day free
trial by setting your PC clock back a month, for example.)  My email
program puts email in the wrong place when the senders computer time is
off. It looks like it was sent way before or way after the response.
Financial systems want accurate time to keep track of money transfers. 

I am guessing this is more than you wanted to know.

Kip

On Sun, 2007-02-04 at 20:39 -0600, Fred James wrote:
> All
> Why would I care about Leap Seconds?  In the first paragraph at 
> <http://cspry.co.uk/computing/Indy_admin/TIMEZONE.html> it says: 
> "However, `TIMEZONE', as implemented in this way in IRIX, does not take 
> into account leap seconds, nor changes made by the European Union and 
> other bodies, in daylight savings time. The TIMEZONE settings have to be 
> altered manually every year, to update them, as changeovers are often 
> variable.**"  Do I care, and if so why?  No, I am not in the UK or 
> Europe - I am in Texas.  Thank you in advance for any help you may be 
> able to offer.
> Regards
> Fred James
> 
> PS:  I am using TZ=CST6CDT5,M3.2.0/2,M11.1.0/2 to deal with the new 
> rules and so far testing has shown it to work on SGI IRIX 6.*, and on 
> Unisys UNIX SVR4 release 2.  I shall be testing on some Linux boxes soon.
> 
> 
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
> 
-- 
Kipton Moravec <kip at kdream.com>




More information about the Discuss mailing list