How To Set or Change Timezone on Ubuntu 20.04 and 21.04

For operating systems having the correct time zone is required for system tasks and processes and down to the minor parts such as logs by your applications. Having incorrect information can impact systems when setting up automatic jobs such as cron jobs that rely on the system’s timezone to execute.

For Ubuntu server users, the time zone by default is not set however, Desktop users with an active Internet connection may have this automatically set up if not, it can be set up in two different ways.

At the end of this guide, you will know how to configure Timezone on Ubuntu 20.04 LTS. The same principle will work for the newer version Ubuntu 21.04 (Hirsute Hippo).

Prerequisites

  • Recommended OS: Ubuntu 20.04 – optional (Ubuntu 21.04 and Linux Mint 20)
  • User account: A user account with sudo or root access.

Advertisement


Timezone Using Terminal

Checking the Current Timezone

First, check to see the current time zone in your Ubuntu Terminal (CTRL+ALT+T) by typing the following command:

timedatectl

Example output:

How To Set or Change Timezone on Ubuntu 20.04 and 21.04

The timezone by default is configured with a (symlink) from (/etc/localtime) to a binary timezone identifier in the (/usr/share/zoneinfo) directory which you can view the current system timezone information by finding the file where the symlink directs to by typing the following command:

ls -l /etc/localtime

Example output:

How To Set or Change Timezone on Ubuntu 20.04 and 21.04

Another way is to use the (cat) command to print the time from the (/etc/timezone) file by typing the command:

cat /etc/timezone

Changing the Timezone with (timedatectl) Command

To change the timezone settings in the Ubuntu terminal, you will first need to find the region and city format. To do this, you will use the (timedatectl) command to print this list in (Region/City) Format.

timedatectl list-timezones

You will find a long list of region/city names, use your (up) and (down) keyboard arrow keys to navigate until you find the timezone you are after. Example below:

How To Set or Change Timezone on Ubuntu 20.04 and 21.04

Once you find the correct entry, you will use (timedatectl) to set the timezone with the following command:

sudo timedatectl set-timezone your_time_zone

For our guide, we set (Australia/Queensland) using the command:

sudo timedatectl set-timezone Australia/Queensland

Next, check to see the timezone has been applied by re-entering the (timedatectl) command:

timedatectl

Example output:

How To Set or Change Timezone on Ubuntu 20.04 and 21.04

Timezone Using the GUI

Ubuntu desktop users have a secondary choice to change the timezone settings instead of using the terminal option. Using the GUI instead, this is done quicker and easier for new users to Linux and Ubuntu.

First, open the system settings, which the quickest way is by clicking in the top right-hand corner of your Ubuntu desktop screen as shown below and clicking on (settings):

How To Set or Change Timezone on Ubuntu 20.04 and 21.04

Next, on the left-hand side, scroll down until you find the (Date & Time) tab and left-click on it to show the timezone settings in the right hand GUI window. By default, this should be automatically set if your operating system is connected to the Internet for desktop users.

How To Set or Change Timezone on Ubuntu 20.04 and 21.04

To select the new timezone, click on the (Time Zone) on the right-hand side, currently where (AEST (Brisbane, Australia) is in our above picture. You will then see a new pop up with a map, here you use the left click of a mouse button to select your location, which will automatically change your time zone on the map.

The example below from switching to (AWST (Perth, Australia) from (AEST (Brisbane, Australia):

How To Set or Change Timezone on Ubuntu 20.04 and 21.04

Once you have selected the correct timezone, click on the (X) in the top right-hand corner to apply, and that is it you have successfully changed a time zone using the GUI.


Advertisement


Comments and Conclusion

In the guide, you have learnt to set your timezone using the terminal and use the GUI if you have a desktop. Overall, I would suggest that novice and new users try the terminal command as it will be more entertaining to learn a new system command than using the default GUI.

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x