Will Ubuntu automatically adjust to the leap second at the end of the year (2016)?

If your Ubuntu machine listens to NTP and synchronizes time with the Internet, the system will automatically adjust itself for the difference in time.

While your computer might not necessarily be aware of the fact that a leap second happened, it will catch and record the event as NTP servers push the change throughout the internet.

If you don't feel like the extra second is being added, you can force an update using the following command:

sudo ntpdate -s pool.ntp.org

This will automatically perform geo-location to give you a nearby server (reducing the latency error) and Ubuntu will adjust for your timezone (so if the server is in a different timezone, it's still all okay). Alternatively, you can use ntp.ubuntu.com.

Note that if you're very unlucky, none of the time servers you're using will handle the leap second correctly. It's unlikely, but possible. Checking manually against a known good source (analogue radio, possibly time.is) is advised.


Alternatively, if you're on a modern version of Ubuntu, there's a built in utility called timedatectl. By default, this runs once automatically on startup. Therefore, a quick reboot can force a sync if necessary.


Leap seconds are handled automatically by the Linux kernel, no reboot or NTP sync is required to keep actual time. If you look in your system log, you will see something similar to

[263284.397894] Clock: inserting leap second 23:59:60 UTC

Since 23:59:60 is not a valid Linux time, your clock will reach 00:00:00, then step back to 23:59:59. Any objects created during that second (like files) can be dated inconsistently.

As far as Linux time (as opposed to real time) is concerned, leap seconds don't exist:

# date -d "2016-12-31 23:59:59" +%s
1483225199
# date -d "2017-01-01 00:00:00" +%s
1483225200

Tags:

Time