How to Change Timezone on Ubuntu 22.04

How to Change Timezone on Ubuntu 22.04

Posted on

Find out how to Change Timezone on Ubuntu 22.04. On this information you’re going to learn to configure or setup your personal timezone on Ubuntu server.

Having a neighborhood time is important in your server for some cronjob or any system associated processes. By default, when a server is provisioned a default timezone will get configured robotically with the Coordinated Common Time (UTC). You’ll be able to change the timezone later utilizing the beneath methodology.

Right here you’ll learn to use the timedatectl command to vary timezone.

Conditions

Entry to server utilizing root or person who has sudo privileges.

Examine Present Timezone

To test the configured time zone that your server makes use of at the moment you should utilize the next command in your Ubuntu 22.04 machine.

timedatectl

You’re going to get an output much like the one beneath.

Output
               Native time: Mon 2022-05-23 01:50:57 UTC
           Common time: Mon 2022-05-23 01:50:57 UTC
                 RTC time: Mon 2022-05-23 01:50:57
                Time zone: And so forth/UTC (UTC, +0000)
System clock synchronized: sure
              NTP service: lively
          RTC in native TZ: no

Now the time zone configured is UTC.

The system timezone is configured by making a symbolic hyperlink of /and so on/localtime to a binary timezone identifier within the /usr/share/zoneinfo listing.

You can too view the timezone by viewing the timezone file created contained in the and so on listing.

cat /and so on/timezone
Output
And so forth/UTC

Change Timezone in Ubuntu

Now you possibly can proceed to vary the default timezone to your location. The time zones in Ubuntu makes use of the “Area/Metropolis” format.

So, it’s essential to discover your area and metropolis utilizing the list-timezones possibility with the timedatectl command.

timedatectl list-timezones

This command outputs all of the accessible time zones.

Output
Africa/Abidjan
Africa/Accra
Africa/Algiers
Africa/Bissau
Africa/Cairo
. . .

Press Enter to load further accessible time zones.

Upon getting discovered your time zone you employ the beneath format to setup your personal time zone.

sudo timedatectl set-timezone your_time_zone

In case your time zone is America/Los_Angeles, your format ought to be like this

sudo timedatectl set-timezone America/Chicago

Now you possibly can once more use the timedatectl command to verify the time zone replace.

Output
               Native time: Solar 2022-05-22 20:53:00 CDT
           Common time: Mon 2022-05-23 01:53:00 UTC
                 RTC time: Mon 2022-05-23 01:53:00
                Time zone: America/Chicago (CDT, -0500)
System clock synchronized: sure
              NTP service: lively
          RTC in native TZ: no

That’s all.

Conclusion

Now you’ve realized the right way to change time zone in your Ubuntu 22.04 machine.

Thanks in your time. In case you face any drawback or any suggestions, please go away a remark beneath.

offshore vps