[time-nuts] June 30 2015 leap second

Tom Van Baak tvb at LeapSecond.com
Tue Jan 6 20:32:08 EST 2015

Here's a nixie clock using javascript. It includes a leap second count down which is now active:

For your project, any GPS module with 1PPS output is a start. Those with NMEA output are problematic. First, there is no advanced notice that a leap second is pending in standard NMEA sentences. Second, some GPS receivers cheat and output a double 23:59:59 or a double 00:00:00 instead of a true 23:59:60 for a positive leap second. Third, the NMEA timestamp follows the 1PPS instead of leads so you only find out too late that there was a leap second.

To get it right, you'll need two external switches that the user can flip to indicate that a leap second should be applied at the end of the current calendar month and what "sign" the leap second is (insert or delete). The state should be reset after the leap second to avoid an accidental leap second the next day or next month. This is what modern atomic clocks like the hp 5071A or FTS 4065B do.

Better GPS receivers, like Oncore, M12, TBolt, and ublox provide a binary interface and from this you get the leap second warning bits without resorting to switches. This is the preferred "automagic" solution.

Note also that leap seconds are applied at UTC midnight, so if your Nixie clock displays local time, including daylight saving time, you have to take this into account. For me the local leap second is 15:59:60 PST or 16:59:60 PDT.

The UNIX epoch time and leap seconds is a can of worms. It's best to think of time_t as a vintage, convenient, compact, binary integer encoding to/from a readable, portable, ascii string yyyy-mm-dd hh:mm:ss that works most of the time except when it doesn't. Your perl script will work, except for leap seconds.

All the external RTC modules I've seen are incompatible with leap seconds. The same is true for any analog clock display (wrist watches, wall clocks).

Big Ben handles leap seconds by adjusting the pendulum rate by an equivalent of 12 ppm a day before the leap. Google handles leap seconds in a similar way:

Most computers don't know if there will be a leap second (and don't care). If you run NTP you get some low level support for leap seconds, but even still most UNIX and Windows software is incapable of displaying or parsing the 23:59:60 leap second correctly.


----- Original Message ----- 
From: "d0ct0r" <time at patoka.org>
To: "Discussion of precise time and frequency measurement" <time-nuts at febo.com>
Sent: Tuesday, January 06, 2015 1:01 PM
Subject: Re: [time-nuts] June 30 2015 leap second

> Hello,
> As I am in the process of creation of my own Nixie clocks. And it 
> probably good time frame to clarify one thing about leap seconds. In my 
> project I am using GPS module as an option to have current UTC time and 
> also to have 1PPS signal to do auto-adjustment for external RTC module. 
> The question is how usually GPS modules handle leap seconds ? Is it 
> satelates who send UTC time to GPS module or GPS module has firmware 
> with leap second information hard-coded ?
> The same question is for UNIX epoch time. How computers knows if it is 
> necessary to add leap seconds ? Lets say I am using very simple script 
> to calculate UNIX time for specified date:
> ========================================================
> #!/usr/bin/perl
> use Time::Local;
> my ($d, $m, $y);
> my $time;
> @myYears = ('01/06/2000', '01/06/2015', '01/06/2038', '01/06/3000');
> foreach (@myYears) {
>         ($d, $m, $y) = split '/', $_;
>         $time = timelocal(0,0,0,$d,$m-1,$y);
>         printf "%ld\n\r", $time;
> }
> ======================================================
> It will produce the following output:
> 959832000
> 1433131200
> 2158977600
> 32516740800
> I am not sure if its take leap second consideration. Most likely not. 
> And that means its only accurate for the present and pas time. Right ? 
> For my clock I already implement the function for the leap second and I 
> am able to add/remove number of seconds from the time I receiving from 
> GPS or any other source. But it will be more inetersting if clock could 
> do it "automagically" and shows me that famous "60" number without human 
> interaction. Any advise for this ? Thanks !
> Regards,
> V.P.
> On , Tom Van Baak wrote:
>> Just announced: there will be a positive leap second at the end of
>> June 30 2015 UTC (that's Wednesday July 1st for most of the world).
>> As usual we time nuts will have a leap second party -- where we
>> capture and share the magic hh:59:60 display on as many different
>> clocks and instruments as possible.
>> /tvb
>> More info:
>> ftp://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat
>> http://hpiers.obspm.fr/eop-pc/
>> And for those of you who want to know how long each day really is:
>> ftp://hpiers.obspm.fr/iers/bul/bulb_new/bulletinb.dat
>> _______________________________________________
>> time-nuts mailing list -- time-nuts at febo.com
>> To unsubscribe, go to 
>> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
>> and follow the instructions there.
> -- 
> WBW,
> V.P.
> _______________________________________________
> time-nuts mailing list -- time-nuts at febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.

More information about the time-nuts mailing list