How to Set or Change Timezone on Ubuntu 24.04

Setting the timezone is crucial for maintaining accurate time on the system. It is used for data logging, cron jobs, global communication, and other time-sensitive tasks. Note that incorrect time can cause abnormalities in system operations such as applications relying on time may not work properly. 

On Ubuntu, the Timezone is set during the installation, however, it can be changed anytime. This guide will discuss setting and changing the timezone on Ubuntu 24.04 codename Noble Numbat using GUI and command line interface.

  1. How to Set or Change the Timezone on Ubuntu 24.04
  2. Change the Timezone using the GUI
  3. Change the Timezone Using timedatectl Command
  4. Change the Timezone using tzdata
  5. Change the Timezone through Zoneinfo Files

How to Set or Change Timezone on Ubuntu 24.04

If you are using Ubuntu Desktop then the timezone can be set or changed easily using GUI. But on the Ubuntu server, you may need to do it using command-line operations. 

  • Using GUI
  • Using timedatectl Utility
  • Through tzdata
  • Through Zoneinfo Files

1. Change the Timezone using the GUI

Timezone can be changed on Ubuntu Desktop from Date & Time settings. The step-by-step procedure to change the timezone using GUI is given below:

Step 1: Open Ubuntu Settings

Open the application launcher on Ubuntu by clicking on the Show Apps icon and then launch Ubuntu Settings.

Step 2: Open Date & Time Settings

Click on the System and then Date & Time settings.

Step 3: Change Timezone through Time Zone Settings

Click on the Time Zone, a window will open with a list of timezones.

Search the city of preference and click on it.

The timezone will be changed.

In the Date & Time option, enable the Automatic Time Zone, it will automatically set the timezone upon connecting with the internet.

2. Change the Timezone Using timedatectl Command

If you are using Ubuntu without the GUI then the timezone can be changed through the terminal. Ubuntu servers do not have GUI, so you have to modify the timezone and other settings through commands. For going for the step-by-step guide to changing the timezone through the terminal, let’s check the current timezone.

The current timezone can be checked using timedatectl command.

timedatectl

The output shows that the current time zone is following the global time standard UTC which stands for Coordinated Universal Time. To change it go through the below given steps:

Step 1: List All Timezones

To select the time, it is important to list all the timezones. The timedatectl command with the list-timezones option can be used to list timezones.

timedatectl list-timezones

Press q to quit the list of timezones.

You can also search a specific timezone by using the pipe and grep command. 

timedatectl list-timezone | grep -i chicago

The -i flag is used to make search case-insensitive.

Step 2: Select the Timezone

From the list of all timezones, note down your preferred timezone.

Step 3: Change the Timezone

To update the timezone via the terminal, you can employ the timedatectl utility using the set-timezone option.

timedatectl set-timezone [timezone]

Replace the [timezone] in the above command with the timezone that you want to set. For example, to set America/Chicago as timezone the execute the following command.

timedatectl set-timezone America/Chicago

You will be prompted to enter the password to complete the authentication.

Step 4: Verify the Timezone

Now, check the timezone whether it is changed or not using timedatectl command.

timedatectl

The timezone has been changed as shown in the above image.

3. Change the Timezone using tzdata

The tzdata is a timezone database that is used to configure time zones on operating system programming languages. It also offers the capability to interactively adjust the timezone settings on Ubuntu. The steps to change the timezone using tzdata are mentioned below:

Step 1: Execute tzdata Configuration Tool

Open the terminal, and run the dpkg-reconfigure command with tzdata to begin the interactive terminal session to change the timezone.

sudo dpkg-reconfigure tzdata

Step 2: Select the Area

Use the directional keys to select the area and press Enter.

Step 3: Select the Timezone

A list of timezones will appear, select the timezone using the directional keys and press Enter on the preferred zone.

A new timezone will appear in the terminal.

You can also verify it by using the timedatectl command.

4. Change the Timezone through Zoneinfo Files

On Ubuntu, the /usr/share/zoneinfo directory contains all the data files of timezones. We can change the timezone by creating the symbolic link of the /etc/localtime file with the timezone information available in the /etc/share/zoneinfo directory.

To change the timezone through zoneinfo files follow the steps given below:

Step 1: Identify the Timezone

The /usr/share/zoneinfo contains all the information about timezones and their binaries. Use the ls command to identify the timezone. 

ls /usr/share/zoneinfo

All the regions will be displayed. Now, further, check the sub-timezones of the regions using the ls command.

ls /usr/share/zoneinfo/America

Note the timezone.

Step 2: Create a Symbolic Link of the Timezone File to the Localtime File

Now, use the ln command to create a symbolic link of /usr/share/zoninfo/<your_timezone> to the /etc/localtime binaries.

sudo ln -sf /usr/share/zoneinfo/America/Dawson /etc/localtime

Step 3: Verify the Timezone

Lastly, verify whether the timezone has changed or not using the timedatectl command.

timedatectl

Conclusion

Setting the correct timezone is crucial for maintaining time-related activities on Ubuntu. There are various methods to set the timezone on Ubuntu 24.04. The quickest method to set the timezone on Ubuntu is using the GUI.

If you are using a Ubuntu server with no GUI then the terminal-based methods utility like timedatectl, can be used to change the timezone. Moreover, the zoneinfo file and modifying the tzdata can also be used to change the timezone on Ubuntu.