http://qs1969.pair.com?node_id=1178967


in reply to Re: Leap second coming up. Check your date handling code (bad theory)
in thread Leap second coming up. Check your date handling code

Back when I was still a teen, I worked (part time) for a small company that had to rely on dial-up modems for internet service. Synchronizing time between the office and the factory (several miles apart) had to be done using WWV radios. We had a simple program (in C) that compared the result of gmtime(time(NULL)) with the time string from the WWV radio, then used adjtime() to "nudge" the system clock as needed.

When a leap second occurred, this "smeared" the extra (or missing) second over the next several minutes, resulting in a gentle transition. (On system boot, though, the time was simply set.)

Within each building, the computers were able to sync to the building's "master" time keeper over Ethernet.

Because I was curious - and the office was on a high enough floor to be able to see the factory buildings - I setup a laser and aimed it at the window of a room in one of the factory buildings. I wired a circuit to a serial port on a computer in the office and to the modulation input of the laser. Then I went to the factory and plugged an optical receiver (I built) into a serial port on a computer, there. Then I ran a shell script to alternately read/display a line from the serial and run the date command. The time on both computers was definitely within 1 second of each other. Probably within .1 second.