Using the correct time zone is essential for many system-related tasks and processes. For example, the cron daemon uses the system’s time zone to run cron jobs, and the time stamps in the log files are based on the same system time zone.
On Ubuntu, the system’s time zone is set during installation but can easily be changed at a later time.
This article describes how to set or change the time zone on Ubuntu 20.04 using the command line or GUI.
Only the root or user with sudo privileges can set or change the system’s time zone.
Check the current time zone
timedatectl is a command line utility that allows you to view and change the system time and date. It is available on all modern systemd-based Linux systems, including Ubuntu 20.04.
To print the current system’s time zone, access the
timedatectl without arguments:
The following output shows that the system’s time zone is set to “UTC”:
Local time: Wed 2020-05-06 19:33:20 UTC Universal time: Wed 2020-05-06 19:33:20 UTC RTC time: Wed 2020-05-06 19:33:22 Time zone: UTC (UTC, +0000) System clock synchronized: yes NTP service: active RTC in local TZ: no
The system time zone is configured through symlinking
/etc/localtime to a binary time zone identifier in
Another option to see the current system’s time zone is to find the file that the symlink points to:
ls -l /etc/localtime
lrwxrwxrwx 1 root root 27 Dec 10 12:59 /etc/localtime -> /usr/share/zoneinfo/Etc/UTC
The system’s time zone is also included in the
Change the time zone with the
Before changing the time zone, you need to find out the long name of the time zone you want to use. The time zones use the “Region / City” format.
To list all available time zones, you can either use the files in
/usr/share/zoneinfo Directory or call the
timedatectl Command with the
... America/Montevideo America/Nassau America/New_York America/Nipigon America/Nome America/Noronha ...
After determining which time zone corresponds to your location, run the following command as the sudo user:
sudo timedatectl set-timezone your_time_zone
For example, to change the system’s time zone to
sudo timedatectl set-timezone America/New_York
timedatectl Command to check the changes:
Local time: Wed 2020-05-06 15:41:42 EDT Universal time: Wed 2020-05-06 19:41:42 UTC RTC time: Wed 2020-05-06 19:41:48 Time zone: America/New_York (EDT, -0400) System clock synchronized: yes NTP service: active RTC in local TZ: no
Change the time zone using the GUI
If you’re running Ubuntu Desktop, you can change the current system’s time zone through the GUI.
Open the System Preferences window by clicking the
SettingsIcon as shown in the picture below:
In the System Preferences window, click the
Date & TimeTab. If the
Automatic Time Zoneto adjust
ONand you have an Internet connection and location service turned on, the time zone should be set automatically according to your location.
To select the new time zone, you can either click on the map or search for a time zone using the search bar.
When you’re done, click
×close the window.
We showed you how to change the time zone of your Ubuntu system.
Feel free to leave a comment if you have any questions.