How to change Time Zone in CentOS 8, RHEL 8 and Ubuntu systems
- To check the current time zone details:
[root@system1 ~]# timedatectl
Local time: Tue 2019-12-17 19:35:07 EAT
Universal time: Tue 2019-12-17 16:35:07 UTC
RTC time: Tue 2019-12-17 16:35:07
Time zone: Africa/Nairobi (EAT, +0300)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
[root@system1 ~]#
- Now decide which time zone to be used and list it from the available zones by:
[root@system1 ~]# timedatectl list-timezones
There are around 426 time zones available in the system running with OS “CentOS Linux release 8.0.1905 (Core)”.
- To search the exact time zone you need use grep command with the above command as below. In this case I am going to set IST as the time zone and trying to find the zones under “/Kolkata” using:
[root@system1 ~]# timedatectl list-timezones|grep -i Kolkata
Asia/Kolkata
[root@system1 ~]#
- Now I am going to set the above time zone to my system.
[root@system1 ~]# timedatectl set-timezone Asia/Kolkata
- Check the time zone now and make sure that it is set with correct TZ.
[root@system1 ~]# timedatectl
Local time: Tue 2019-12-17 22:11:57 IST
Universal time: Tue 2019-12-17 16:41:57 UTC
RTC time: Tue 2019-12-17 16:41:56
Time zone: Asia/Kolkata (IST, +0530)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
[root@system1 ~]#
Now my local time set to IST as shows above.
Comments
Post a Comment