System timezone is first set during system installation for Ubuntu. The installer automatically selects the timezone based on your current location, though you can choose any timezone from the map for your system.
The system timezone is set using the /etc/localtime file. You can change the timezone of your Ubuntu system after installation by creating a softlink from /etc/localtime to the appropriate timezone info files available in the /usr/share/zoneinfo folder. The other method is to use a helper program such as timedatectl.
Steps to change system timezone in Linux:
- Launch terminal.
- Check currently-used timezone using timedatectl.
$ timedatectl Local time: Jum 2020-08-21 09:30:04 +08 Universal time: Jum 2020-08-21 01:30:04 UTC RTC time: Jum 2020-08-21 01:30:04 Time zone: Asia/Kuala_Lumpur (+08, +0800) System clock synchronized: yes NTP service: active RTC in local TZ: no
- Check for available timezones in the system.
$ timedatectl list-timezones Africa/Abidjan Africa/Accra Africa/Algiers Africa/Bissau Africa/Cairo Africa/Casablanca Africa/Ceuta Africa/El_Aaiun Africa/Johannesburg Africa/Juba Africa/Khartoum ##### snipped
- Search for your timezone from the list of available timezones.
$ timedatectl list-timezones | grep -i tokyo Asia/Tokyo
- Set new timezone using timedatectl.
$ sudo timedatectl set-timezone Asia/Tokyo [sudo] password for user:
The above command is similar to doing the following two manual steps:
- Unlink your currently-used timezone.
$ sudo unlink /etc/localtime [sudo] password for user:
- Link /etc/localtime to your new timezone.
$ sudo ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
- Confirm changes using timedatectl.
$ timedatectl Local time: Jum 2020-08-21 10:34:29 JST Universal time: Jum 2020-08-21 01:34:29 UTC RTC time: Jum 2020-08-21 01:34:29 Time zone: Asia/Tokyo (JST, +0900) System clock synchronized: yes NTP service: active RTC in local TZ: no
Author: Mohd
Shakir Zakaria
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Discuss the article:
Comment anonymously. Login not required.