Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-28-2012
Registered User
 
Join Date: Jun 2012
Posts: 12
Thanks: 3
Thanked 0 Times in 0 Posts
Leap second happening

Have anybody heard about the Leap second problem

Leap second :A leap second is a one-second adjustment that is occasionally applied to Coordinated Universal Time (UTC) in order to keep its time of day close to the mean solar time.

How could i avoid such thing in my script which i deal with times

source :Leap second - Wikipedia, the free encyclopedia
Sponsored Links
    #2  
Old 06-28-2012
Registered User
 
Join Date: Aug 2006
Posts: 314
Thanks: 1
Thanked 47 Times in 45 Posts
What problem do you expect your script to run into because of a leap second? How does your script handle the leaps caused by daylight saving time?
Usually a leap second should not be a problem. Is the box you run your script on using ntpd or xntpd to synchronize time? If so you can configure it to synchronzie slowly. Have a look at ntpd.drift.

Last edited by cero; 07-02-2012 at 02:47 AM.. Reason: Typo
Sponsored Links
    #3  
Old 07-01-2012
methyl methyl is offline Forum Staff  
Moderator
 
Join Date: Mar 2008
Posts: 6,388
Thanks: 286
Thanked 668 Times in 640 Posts
My old HP-UX 11.11 server survived.

From /usr/adm/syslog/syslog.log:

Code:
Jul  1 01:00:01 unidev xntpd[1601]: leap second occurred, stepped time back 1 second

    #4  
Old 07-01-2012
...@...
 
Join Date: Feb 2004
Location: NM
Posts: 9,656
Thanks: 164
Thanked 645 Times in 622 Posts
Interesting - POSIX ignores leap seconds. I do not remember, but it looks like HPUX does not play POSIX. I left HPUX with v11.

Last edited by jim mcnamara; 07-01-2012 at 11:15 AM..
Sponsored Links
    #5  
Old 07-01-2012
...@...
 
Join Date: Feb 2004
Location: NM
Posts: 9,656
Thanks: 164
Thanked 645 Times in 622 Posts
I would not worry about it. You will notice that timekeeping structures like struct stat and struct tm (standard C, which is the basis of timekeeping in UNIX) are leap-second aware.

Leap seconds are kept by Linux. And shells there are compliant with it. This is true only if the box is connected to an ntp service. Tracking leap seconds is not required by POSIX, so your OS may not care. What OS do you have?

Unless you are doing precision time keeping like GPS, Realtime device monitoring, or Astronomy, it will NOT break what you are doing. Since you asked the question, I'm pretty sure you cannot be involved in something that would be affected in any way.
Sponsored Links
    #6  
Old 07-01-2012
Scrutinizer's Avatar
Moderator
 
Join Date: Nov 2008
Location: Amsterdam
Posts: 7,350
Thanks: 144
Thanked 1,755 Times in 1,592 Posts
Systems should be able to deal with it, although it seems that some Linux distributions had a problem with it.. If a system allows the leap second to be represented by hh:mm:60 then scripts and programming practices where the seconds range is defined as 0..59 can run into trouble...

Last edited by Scrutinizer; 07-01-2012 at 11:44 AM..
Sponsored Links
    #7  
Old 07-01-2012
drl's Avatar
drl drl is offline Forum Advisor  
Registered Voter
 
Join Date: Apr 2007
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 1,483
Thanks: 15
Thanked 135 Times in 122 Posts
Hi.

A few GNU/Linux seem to have produced a message about it:

Code:
Jun 30 18:59:59 (drl) kernel: [160267.112938] Clock: inserting leap second 23:59:60 UTC
Jun 30 18:59:59 vm-centos kernel: Clock: inserting leap second 23:59:60 UTC
(no messages from openSUSE 11.4)
(no messages from ubuntu 11.10)
(no messages from fedora 15)
(no messages from Solaris 10 10/08)
(no messages from FreeBSD, 8.0-RELEASE)
(no messages from Debian GNU/kFreeBSD 6.0)

cheers, drl
The Following User Says Thank You to drl For This Useful Post:
methyl (07-01-2012)
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Number of leap seconds NAVTime UNIX for Dummies Questions & Answers 4 06-05-2009 06:29 PM
Leap year K-shell script p1jls02 UNIX for Dummies Questions & Answers 2 11-18-2008 02:13 PM
Leap Second isingh786 HP-UX 1 12-28-2005 01:29 PM
Insertion of Leap Second isingh786 UNIX for Advanced & Expert Users 2 12-28-2005 01:05 PM
Ping is happening, telnet is not happening b_manu78 AIX 2 02-03-2005 02:16 AM



All times are GMT -4. The time now is 09:35 AM.