How To Change TimeZone on AlmaLinux 9

In this wiki article, we will learn how to change the timezone in AlmaLinux 9 using the timedatectl command.

To check your current TimeZone

To get detailed information current date, time, and timezone on AlamaLinux use the timedatectl command.

timedatectl

Output:

[root@server ~]# timedatectl
               Local time: Mon 2022-05-23 20:17:49 CEST
           Universal time: Mon 2022-05-23 18:17:49 UTC
                 RTC time: Mon 2022-05-23 18:17:49
                Time zone: Europe/Amsterdam (CEST, +0200)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

The TimeZone configuration on AlmaLinux 9 OS is stored set by the /etc/localtime file. This file is a symbolic link to a timezone file under /usr/share/zoneinfo.

To get a basic view of the timezone you can ls the file to its symbolic link.

ls -l /etc/localtime

Output:

ls -l /etc/localtime
lrwxrwxrwx. 1 root root 38 May 20 16:14 /etc/localtime -> ../usr/share/zoneinfo/Europe/Amsterdam

Listing TimeZones

Using timedatectl command to list TimeZones,

timedatectl list-timezones

Output:

[root@server ~]# timedatectl list-timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
Africa/Brazzaville
Africa/Bujumbura
Africa/Cairo
Africa/Casablanca

Set your Preferred TimeZone

Once you have the list of timezones, you can set the one you prefer.

timedatectl set-timezone your_time_zone

Example:

timedatectl set-timezone Africa/Malabo

To confirm your changes were applied by running the timedatactl command.

timedatectl

Output:

[root@server ~]# timedatectl set-timezone Africa/Malabo
[root@server ~]# timedatectl
               Local time: Mon 2022-05-23 19:22:42 WAT
           Universal time: Mon 2022-05-23 18:22:42 UTC
                 RTC time: Mon 2022-05-23 18:22:42
                Time zone: Africa/Malabo (WAT, +0100)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
[root@server ~]#

CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS