How to set timezone on RHEL Linux Host from RHEL 7 onwards ?

Lets see how to set timezone on Redhat Linux from RHEL 7 onwards.

Earlier we used to link the timezone files.

However now we can do it via a command known as timedatectl.

1. Check Current timezone

[root@ngelinux01-502 ~]# timedatectl
      Local time: Mon 2024-01-22 14:34:50 +07
  Universal time: Mon 2024-01-22 07:34:50 UTC
        RTC time: Mon 2024-01-22 14:34:37
       Time zone: Indian/Christmas (+07, +0700)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: yes
      DST active: n/a

Warning: The system is configured to read the RTC time in the local time zone.
         This mode can not be fully supported. It will create various problems
         with time zone changes and daylight saving time adjustments. The RTC
         time is never updated, it relies on external facilities to maintain it.
         If at all possible, use RTC in UTC by calling
         'timedatectl set-local-rtc 0'.

 

2. List the available timezones.

[root@ngelinux01-501 ~]# timedatectl list-timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako

 

3. Set new timezone

[root@ngelinux01-502 ~]# timedatectl set-timezone Asia/Kolkata
[root@ngelinux01-502 ~]# date
Mon Jan 22 13:05:42 IST 2024
[root@ngelinux01-502 ~]#

Similarly you can set any timezone required.

And there is no reboot, or service restart required.

This command automatically does the configuration.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments