How to Change the Time Zone in Ubuntu 20.04. In this guide you will learn how to configure or set your own time zone on the Ubuntu server.
Having local time is needed on your server for some cronjob or any system related process. By default, when a server is given the default time zone will be configured automatically with Coordinated Universal Time (UTC). You can change the time zone later using the method below.
Here you will learn how to use timedatl commands to change time zones.
Access to the server uses root or users who have sudo rights.
Check the Current Time Zone
To check the configured time zone that your server currently uses, you can use the following command on your Ubuntu 20.04 machine.
You will get an output similar to the one below.
Output Local time: Wed 2020-07-22 08:08:33 UTC Universal time: Wed 2020-07-22 08:08:33 UTC RTC time: Wed 2020-07-22 08:08:34 Time zone: Etc/UTC (UTC, +0000) System clock synchronized: yes NTP service: active RTC in local TZ: no
Now the configured time zone is UTC.
The system time zone is configured by creating a symbolic link from / etc / localtime to the binary time zone identifier in the / usr / share / zoneinfo directory.
You can also see the time zone by looking at the timezone file created in the directory etc.
Change Timezone on Ubuntu
Now you can continue to change the default time zone to your location. The time zone in Ubuntu uses the “Region / City” format.
So, you need to find your region and city using the timezone option with the timedectl command.
This command displays all available time zones.
Output Africa/Abidjan Africa/Accra Africa/Algiers Africa/Bissau Africa/Cairo . . .
Press Enter to load the available additional time zones.
After you find your time zone, you use the format below to set your own time zone.
sudo timedatectl set-timezone your_time_zone
If your time zone is America / Los_Angeles, your format should look like this
sudo timedatectl set-timezone America/Los_Angeles
Now you can use the Timedatl command again to confirm the time zone update.
Output Local time: Wed 2020-07-22 01:51:43 PDT Universal time: Wed 2020-07-22 08:51:43 UTC RTC time: Wed 2020-07-22 08:51:44 Time zone: America/Los_Angeles (PDT, -0700) System clock synchronized: yes NTP service: active RTC in local TZ: no
That is all.
Now you have learned how to change the time zone on your Ubuntu 20.04 machine.
Thank you for your time. If you encounter a problem or feedback, please leave a comment below.