In this tutorial, we will show you how to change the time zone on the Ubuntu operating system.
The correct time zone significantly helps when scheduling tasks, setting up cron jobs, and viewing the various logs your system produces. Having logs in your own time zone can help make it easier to see when events occur.
On Ubuntu desktop, the time zone will ensure that the time and date are correct for the clock.
Under the hood Ubuntu tracks both a universal time and a local time. The universal time is the current time using UTC. The local time is what your chosen time zone is applied to.
Typically, you would setup the time zone during the initial setup process of Ubuntu. However, the system comes with the tools that make changing this at any time a very straightforward process.
By the end of this guide, you will know how to change the time zone on Ubuntu using the terminal or desktop interface.
Changing the Time Zone on Ubuntu using the Terminal
In this section, we will show you how to change the time zone on Ubuntu while using the terminal.
The following steps are especially useful if you use Ubuntu Server, but they will also work on the desktop variant.
If you are using the desktop version of Ubuntu, you can open the terminal by pressing CTRL + ALT + T on your keyboard.
Checking the Current Time Zone
1. Before we get started, we should check what the time zone is currently set to. This helps check whether your time and date are incorrect on Ubuntu because of the time zone or another issue.
To list the current time zone, you will want to use the following command within the terminal.
timedatectl
2. After running the previous command, you will see Ubuntu’s time zone information printed to the command line.
The information you are after is after the “Time zone” label.
Local time: Wed 2023-10-04 09:04:01 BST
Universal time: Wed 2023-10-04 08:04:01 UTC
RTC time: n/a
Time zone: Europe/London (BST, +0100)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
3. From this data, you can see our Ubuntu device’s time zone is currently set to “Europe/London
” when we need it to be “Australia/Hobart
“.
Time zones on Ubuntu and most Linux systems are written as “REGION/CITY
“. But it can also be set to “UTC
” or “GMT
“.
Changing the Time Zone on Ubuntu using the Terminal
4. Now that you know your current time zone, let us move on to how to change it. The same tool that allowed us to view the current time zone will also allow us to change it to a new one.
Before you change the time zone on Ubuntu, you must know what you want to change it to.
You can get a list of the time zones by using the following command. Alternatively, you can view a list on Wikipedia; just pay attention to the “TZ Identifier
” column.
timedatectl list-timezones
5. After working out what time zone you want to set, you must use the following command within the terminal.
This command uses the timedatectl command to set the specified time zone on Ubuntu.
sudo timedatectl set-timezone
For example, if we wanted to set the time zone on our Ubuntu device to “Australia/Hobart
” we would use the following command.
sudo timedatectl set-timezone Australia/Hobart
6. You can verify that your Ubuntu time zone was successfully updated by using the timedatectl command again.
timedatectl
After running the update command, you should see that your times now match that of your time zone. Additionally, you should see the “Time zone
” now matches the one you set.
Local time: Wed 2023-10-04 20:08:44 AEDT
Universal time: Wed 2023-10-04 09:08:44 UTC
RTC time: n/a
Time zone: Australia/Hobart (AEDT, +1100)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Using the Ubuntu Desktop to Change the Time Zone
If you are running a desktop variant of Ubuntu, you can always change the time zone using the settings screen. This is a good alternative for anyone who doesn’t feel comfortable messing around within the command line.
These steps were written for Ubuntu 22.04, but they should work for most releases of Ubuntu. The location of the buttons may differ slightly.
1. Our first task is to open the settings screen on our Ubuntu device.
Opening the activities panel is one of the easiest ways to get to the settings menu. You can open this panel by clicking the top or bottom left side of the screen.
2. With the activities screen open, use the search bar at the top of the screen to look for “Settings
” (1.).
After searching, you should see a cog appear on the screen (2.). Click the cog to open the settings panel.
3. Now that the settings panel is open, change to the “Date & Time
” menu in the sidebar (1.).
Next, you must ensure the “Automatic Time Zone
” option is switched off (2.). If this is set, Ubuntu will override the time zone with the one it discovered using location services.
We can now finally open the time zone settings by clicking the “Time Zone
” option (3.).
4. There are two ways you can use this screen to change your time zone on Ubuntu.
- The first way is the search bar at the top of the screen. Using this, you can type in your city, and it will quickly find the correct time zone.
- The second way is to use the map. You can click anywhere on the map, and it will select the corresponding time zone.
5. Below you can see how we changed our Ubuntu systems time zone from PDT to AEDT.
Conclusion
At this point, you should hopefully understand how to change the time zone on the Ubuntu operating system.
Whether you use the desktop or terminal, updating the time zone is relatively straightforward. In the command line the timedatectl command handles most of the hard work.
Please leave a comment below if you have any questions about updating the time zone on your system.
If you found this tutorial to be useful, please check out our many other Ubuntu guides.