-1

Did you ever watch what happens with a sleep during a leap second or what date will show us? Most UNIX systems can handle a sleep with a fraction of a second and the date command can display milliseconds. I didn't look at the source but will the sleep wake up during the leap second? probably yes. And what will "date" show? the POSIX definition says it is 23:59:60

If I have time I will take a close look at this script:

while true; do sleep 0.1; date '+%m%d %H:%M:%S %3N'; done

The leap-seconds.3629404800 file says 1 Jul 2015 which I installed for the ntp daemon.

Then we have the next possibility to watch.

3
  • 5
    Is there an actual question here?
    – MadHatter
    Feb 17, 2015 at 20:25
  • This is an interesting question. Does it really need the down and close votes?
    – Doug Luxem
    Feb 17, 2015 at 21:02
  • @DougLuxem Because there isn't a question in there, and it's therefore unclear what he's asking. It could be an interesting question, but right now, it's just a confusing collection of sentences that has something to do with *nix and time-keeping. Feb 18, 2015 at 4:40

1 Answer 1

3

I think what you're getting at is, "what does it look like within the system when a leap second is happening", right?

Pretty much the same as a time zone's daylight savings change, if your servers are unfortunate enough to be set up on a daylight savings clock.

If an extra second (or hour) is being added, the timestamp will happen twice: at the end of the leap second, time will be reset back to the start of the leap second.

If a second (or hour) is removed, those times are skipped and apparent timestamps will jump forward.

2
  • The two things are not really the same since when DST happens, the clock keeps counting the number of seconds since the epoch, and that value keeps increasing by one every second. It is only the conversion between this internal representation and human presentation format, which changes. However in case of a leap second, the number of seconds since the epoch actually does jump backwards.
    – kasperd
    Feb 17, 2015 at 20:54
  • @kasperd That's a good point. Another big difference is the implementation of the leap second signal (and all the fun that caused last time). Feb 17, 2015 at 20:56

Not the answer you're looking for? Browse other questions tagged .