Keep clocks in sync with Internet time servers on Ubuntu 18.04

It is best to synchronize your watch with the Internet according to the specified time zone, unless you need to manually change the system time. This article describes ways to use the command line and the Ubuntu 18.04 LTS (Bionic Beaver) GUI to synchronize your watch with time servers on the Internet. This feature was originally designed for older computers that could not keep up with the current time.

Synchronizing clocks with time servers via the command line

Check current time status

The timedatectl command allows you to check the current state of the system clock. Open your Ubuntu terminal with Ctrl + Alt + T and enter the following command:

$ timedatectl status

Check the time with timedatectl

Among other things, you can see local time, universal time, and whether your system clock is synchronized with time servers on the Internet or not.

Synchronize system time

IN chronid The command allows you to check the time at which the system clock is off. If you run the chronyd command without first installing the utility, you will receive the following message:

Chronyd command

Please install the Chrony utility as follows:

$ sudo apt install chrony

Install software: chrony

Then you can use the following command to find out how much your time is different from the internet server. The line “System clock is incorrect” in the output indicates this.

$ sudo chronyd -Q

You can also synchronize the system time and see the “System clock is incorrect” information in one go by running the following command:

$ sudo chronyd -q

In the following example, you can see that when I ran the chronyd -q command for the first time, my system went offline for 95.9 seconds. After running the command, my internet time was reset and this can be seen when I rerun the command. This time, my system clock is only -0.001446 seconds behind, which is a minor difference.

Using chronides

On Ubuntu Desktop (GUI)

Operating systems these days are set up to automatically retrieve date, time, and time zone data over the Internet. You can configure your system to receive the date and time according to the selected time zone as follows:

Click the down arrow located in the upper right corner of your Ubuntu desktop and then click the icon settings icon located in the lower left corner:

Click on the settings icon

OR

A type Settings in Ubuntu Dash as follows:

Open settings

Click the icon Details tab and then select date and time option.

Make sure the Automatic Date and Time button is on. This will allow you to automatically retrieve the current date and time from the internet server.

Automatic date and time synchronization

By following the steps in this guide, you can be 100 percent sure that the current time on your system is in sync with the time on your Internet time server.

Keep clocks in sync with Internet time servers on Ubuntu 18.04

Sidebar