How To Synchronize Time Zone & System Time in Ubuntu 16.04

We explain the steps to know how to synchronize the time zone and system time in Ubuntu 16.04

It is vital to maintaining a correct configuration of the system time since this depends on many processes working correctly and even more if we talk about a business environment.

Make Time Adjustments Graphically

This is perhaps one of the simplest ways we manage to adjust the time zone in the system. For this, we click on the system time located in the upper right, and there we select the option Time & Date Settings:

The following window will be displayed where we must activate the box manually and then enter the time zone to be set in the Location field and from the options shown choose the appropriate one.

If we wish we can locate our time zone on the map displayed.

Set Time Zone using the Terminal

For lovers of the terminal in Ubuntu we have some options that give us the opportunity to define the time zone. In Ubuntu environments we will access the terminal and execute the following command:

sudo dpkg-reconfigure tzdata

Press Enter and the following will be displayed:

There we must select the geographical area where the area to be assigned is located, then we will see the respective cities of that area:

Select the appropriate option and click OK.

Adjust Time Zone using Commands

The use of various commands in Ubuntu gives us the possibility to establish the time zone directly and safely. First we will execute the date command to check the current time zone:

Now we will access the zone configuration file in Ubuntu running the following line:

cd /usr/share/zoneinfo

Once there we execute the tzselect command where we will follow the following steps:

  • Define the geographical area indicating the respective number
  • Assign the country on which the system time will depend by entering the assigned number
  • Enter the respective confirmation, 1 (yes), 2 (no).

This has modified the time zone using the tzselect command.

Set Time Zone using NTP

NTP (Network Time Protocol) is a protocol developed with the purpose of synchronizing the clocks of the different operating systems with servers worldwide. To make use of NTP in Ubuntu, we will first install it by executing the following command:

sudo apt install ntp

Once installed, we will access the NTP configuration file by executing the following line:

sudo nano /etc/ntp.conf

There we can see that by default NTP uses 4 different servers to synchronize the respective clocks.
These must be modified taking into account the geographical area to be assigned:

Save the changes using the Ctrl + O keys and exit the editor using the Ctrl + X keys.

We restart the NTP service by executing the following line:

sudo systemctl reload ntp.service

If we want to see the NTP status we can run the following command:

sudo ntpq –p

We have checked the various options available for setting the time zone in Ubuntu 17.04.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *