Change timezone in Ubuntu Server 22.04

Change timezone in Ubuntu Server 22.04
Photo by Jon Tyson / Unsplash

We often times have to change the timezone on our machines that we are using as our developer machine. Below you will find a few snippets related to how you can make sure that your system has the right timezone.

To list timezones you can run

timedatectl list-timezones

To set the timezone you can run

sudo timedatectl set-timezone Asia/Dhaka

Now you can use the timedatectl command to confirm the time zone update.

Output

               Local time: Fri 2022-11-18 18:32:12 +06
           Universal time: Fri 2022-11-18 12:32:12 UTC
                 RTC time: Fri 2022-11-18 12:32:13
                Time zone: Asia/Dhaka (+06, +0600)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no