Open In App

How To Set or Change Timezone on Ubuntu 20.04

Last Updated : 07 Mar, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Setting up the right time zone on your Ubuntu machine is extremely important for various reasons. Numerous tasks as well as background operations depend on the accurate time zone of your system. Some of the things that depend on the configured time zone setting include; log files which contain dates and times, scheduled jobs that run automatically, etc. When you first install Ubuntu, you set the time zone. But what if you need to update it later – like if you move to a new region? Not a problem.

This guide will show two simple methods of changing the time zone in your Ubuntu 20.04 computer, depending on whether you prefer using commands or a graphical interface. Be sure not to miss any appointments or get confused with local times by just following a few mouse clicks or keystrokes.

How To Set or Change Timezone on Ubuntu 20.04

1. Check the Current Timezone

The timedatectl command is a utility that allows you to view and change the system’s time and date settings. It is available on all modern systemd-based Linux distributions, including Ubuntu 20.04.

To display the current timezone, run the timedatectl command without any arguments.

Command :

timedatectl

The output will show the system’s current timezone information, similar to the following :

1

System’s current timezone

In this example, the system’s timezone is set to “UTC”.

Alternatively, you can check the current timezone by examining the symbolic link /etc/localtime, which points to a binary timezone identifier in the /usr/share/zoneinfo directory.

Command :

ls -l /etc/localtime

The output might look like this :

2

The system’s timezone is also stored in the /etc/timezone file. You can view its contents using.

Command :

cat /etc/timezone

This will display the current timezone, for example :

3

2. Change the Timezone Using the timedatectl Command

Before changing the timezone, you’ll need to find the appropriate name for the timezone you want to use. Timezones follow the “Region/City” format.

To list all available timezones, you can either list the files in the /usr/share/zoneinfo directory or use the timedatectl list-timezones command.

Command :

timedatectl list-timezones

This will display a list of timezones, such as :

4

Once you identify the timezone that matches your location, run the following command with sudo privileges:

Command :

sudo timedatectl set-timezone your_time_zone

For example, to change the system’s timezone to America/New_York:

Command :

sudo timedatectl set-timezone America/New_York

Output :

5

After running the command, you can verify the change by invoking timedatectl again:

Command :

timedatectl

The output will reflect the new timezone, similar to this:

6

3. Change the Timezone Using the Inbuilt Settings (GUI)

If you are running Ubuntu Desktop, you can change the current system’s timezone through the graphical user interface (GUI).

1. Open the system settings window by clicking on the Settings icon.

7

2. In the system settings window, click on the Date & Time tab. If the Automatic Time Zone is set to ON and you have an Internet connection and location service enabled, the timezone should be automatically set according to your location.

8

3. To manually select a new timezone, you can either click on the map or search for a timezone using the search bar. After selecting the desired timezone, click on the close button to apply the changes and close the window.

9

Conclusion

It is important to maintain the correct timezone on your Ubuntu 20.04 system because many things depend on it for them to function properly. However, you can easily change this setting. If you like working with a command line interface, then you may go ahead and use timedatectl command that will give you a list of all available timezones where you can pick one according to your preference. On the other hand, if you like graphical interfaces, then open “Date & Time” settings and choose your timezone from the drop-down menu or map provided there. Regardless of how one goes about it, ensuring that the system’s time zone is accurate in terms of scheduled tasks, log timestamps and any other time-based activities will guarantee proper functioning of such operations.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads