Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Per Westermark
09/07/12 05:37
Read: 674 times

Msg Score: +1
 +1 Good Answer/Helpful
#188261 - Leap seconds can almost always be ignored
Responding to: Konstantinos L. Angelis's previous message
Leap seconds are normally ignored since they are way too short and to few in relation to the quality of normal clocks. And not placed according to mathematical formulas but actual measurements.

Your PC don't have any leap seconds. The unix epoch time don't have any leap seconds. The only thing is that in some situations, programs should be prepared to survive seeing a seconds value of 60 and not just 0..59.

Leap seconds can be important to know about when converting from raw GPS time into UTC time, since the GPS time reference is not using leap seconds and so drifts away from UTC time. Note that the GPS may hide this by adding an offset before presenting any time.

Leap seconds can also be important do be able to detect, when picking time info from a time reference somewhere, where the received time can have 60 as seconds value. But the next value will still be zero, so a program receiving 60 in the seconds field can pretend it saw 59.

The important thing here is that the leap seconds are decided about based on measurements. They aren't inserted from a mathematical rule. So you can't write an algorithm that takes care of them, without also making use of a lookup table that gets regularly updated based on decisions made about when next to insert a leap second.

So no - I don't agree about that "must be implemented as feature and not an option".

When a time protocol (or an user) sets the time 2012-09-07 11:16:20 to an embedded device, that embedded device don't need to know how many leap seconds there have been since 1972, unless the embedded device is used for very, very specific tasks. And in that case, the internal time values internally will not be any unix epoch of seconds since 1970-01-01 anyway.

If an embedded device picks up the time from a GPS, it is important to check if the GPS sends out the raw GPS time, or if the GPS was designed to make a 20+ second correction. But still - that don't give you anywhere to add in any algorithmic processing of leap seconds. An embedded device don't know if there have been more leap seconds unless the user changes that offset or unless the embedded device have network access to a server somewhere to look up a list of past and comming leap seconds.

The ultimate embedded device for handling time is a normal clock. Our clocks obviously don't have any need to know about leap seconds unless they are set from a radio-based time reference. And then they still don't need to know about the number of leap seconds - just that they can convert the second value 60 to 59 because the next seconds value will still be 0.

List of 22 messages in thread
Error in conversion from Unix EPOCH       Raghunathan      09/05/12 10:03      
   zero        J. Guy      09/05/12 10:32      
   DMonth[month-1] ????        Stefan KAnev      09/05/12 11:50      
      Stefan is correct and...      Daniel Contarino      09/05/12 14:11      
         +4 - 100 + 400      Per Westermark      09/05/12 14:46      
            right, but...      Stefan KAnev      09/05/12 14:54      
               88 years is a long time      Per Westermark      09/05/12 14:55      
                  That is what they said in the 60's      Neil Kurzman      09/06/12 13:46      
      Thanks. Problem solved      Raghunathan      09/05/12 22:26      
         Cross-checking important      Per Westermark      09/06/12 00:10      
            Just a foot note about the year      Per Westermark      09/06/12 03:00      
               ?back conversion      Stefan KAnev      09/06/12 04:56      
                  No - multiplier should not be 366      Per Westermark      09/06/12 05:21      
                     Running out of seconds > 1970      David Prentice      09/06/12 10:00      
                        signed is actually common - to support dates before 1970      Per Westermark      09/06/12 12:42      
                        Will You Now.      Neil Kurzman      09/06/12 13:53      
                           Have you considered leap seconds?      KONSTANTINOS L. ANGELIS      09/07/12 05:00      
                              Leap seconds can almost always be ignored        Per Westermark      09/07/12 05:37      
                                 Time is passing anyway or is it just an illusion?      KONSTANTINOS L. ANGELIS      09/07/12 07:00      
                                    Missiles? Leap seconds contra way larger drift...      Per Westermark      09/07/12 07:45      
         No such thing as a free lunch!      Andy Neil      09/07/12 15:28      
   Link?      Andy Neil      09/08/12 03:16      

Back to Subject List