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.
$ 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
$ 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
$ timedatectl list-timezones | grep -i tokyo Asia/Tokyo
$ sudo timedatectl set-timezone Asia/Tokyo [sudo] password for user:
The above command is similar to doing the following two manual steps:
$ sudo unlink /etc/localtime [sudo] password for user:
$ sudo ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
$ 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
Comment anonymously. Login not required.