See last page for copyright and document info, File: Reeve_GpsNtp-Pi_Setup.doc, Page 26
9. Leap seconds
Download the most recent leap-second file from one of the following sources and place it on your Desktop.
These files have an expiration date so always download the latest one. The filename will be of the form
leap-
seconds.3629404800
, where the number string will vary. The web address of the necessary leap-second file
varies over time but can be found by internet search (“NTP leap second file”). The following addresses are valid
during February 2020:
ftp://ftp.nist.gov/pub/time/
ftp://ftp.boulder.nist.gov/pub/time/
Rename the downloaded file to
leap-seconds.file
(that is, replace the number string with the word “file”). Using
WinSCP go to the /home/pi/ directory on the RPi, right-click in the right-hand window and select New –
Directory.... Name the new directory ntp, as in /home/pi/ntp. Select the /ntp directory so that it is open in the
right-hand window (it will be empty). Now, drag leap-seconds.file from the Desktop to the new /ntp directory.
Open a PuTTY shell session (if not already open) and log into the RPi. If desired, PuTTY can be open from WinSCP
in Commands menu – Open in PuTTY or Ctrl-P. At the RPi prompt open the ntp.conf file in the nano editor:
sudo nano /etc/ntp.conf
Add a line that references the leap-second file at the above location:
# Location of leap seconds file
leapfile /home/pi/ntp/leap-seconds.file
Type CTRL-X (Exit), Y (yes), Enter to save and close the editor.
Restart the NTP service:
sudo service ntp restart
After a few minutes, query the NTPD
ntpq -crv
The” leapsec” parameter will be seen near the end of the list and its value should be the date and time of the
next leap second as defined in the leap second file. In the screenshot below the date and time values are 1 July
2015 and 0000 UTC, which is the next leap second at the time this guide was written (February 2015). The
expiration date of the leap second file also is shown, 28 December 2015 at 0000 UTC. If this guide is used after
this expiration date, a newer leap second file will be available with a newer expiration date. The leap second file
should be kept updated.