Computer Science Atlas
Tutorial

How to Change / Set the System Timezone on Ubuntu 20.04

February 15, 2021
 

Step 1. Open a Terminal Session

If you're using an Ubuntu laptop or desktop, you can press Ctrl + Alt + T on your keyboard to open a new terminal window. If you're using a remote Ubuntu server, you can connect using SSH to open a new terminal session.

Step 2. Choose a Timezone

Ubuntu uses tz database timezones. You can use the following command to view timezones available on your system:

Bash
Copy
timedatectl list-timezones
$
timedatectl list-timezones

or consult Wikipedia's list of timezones to choose the timezone you want.

Step 3. Set Timezone

Now let's use the timezone name you selected in the previous step to set the timezone using the timedatectl set-timezone command with sudo (administrator privileges). If the command asks you for a password, you can enter your Ubuntu password.

For example, if you selected UTC:

Bash
Copy
sudo timedatectl set-timezone UTC
$
sudo timedatectl set-timezone UTC

Or if you selected America/Los_Angeles:

Bash
Copy
sudo timedatectl set-timezone America/Los_Angeles
$
sudo timedatectl set-timezone America/Los_Angeles

Step 4. Display Timezone to Verify

You can verify your change by running the timedatectl command with no arguments and no sudo:

Bash
Copy
timedatectl
$
timedatectl

You should see output similar to the following:

Out
Copy
               Local time: Mon 2021-02-15 11:44:28 PST     
           Universal time: Mon 2021-02-15 19:44:28 UTC     
                 RTC time: Mon 2021-02-15 19:44:29         
                Time zone: America/Los_Angeles (PST, -0800)
System clock synchronized: yes                             
              NTP service: active                          
          RTC in local TZ: no
               Local time: Mon 2021-02-15 11:44:28 PST     
           Universal time: Mon 2021-02-15 19:44:28 UTC     
                 RTC time: Mon 2021-02-15 19:44:29         
                Time zone: America/Los_Angeles (PST, -0800)
System clock synchronized: yes                             
              NTP service: active                          
          RTC in local TZ: no

Congratulations!

You've now set the system timezone on your Ubuntu machine.