How to change Time Zone in CentOS 8, RHEL 8 and Ubuntu systems



 Time zone is managed by a command called “timedatectl” provided by the package “systemd-239-13.el8.x86_64”.

  • 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

Popular posts from this blog

AIX Firefox Installation

AIX Commands

How to increase swap size on CentOS 8 / RHEL 8

How to configure NTP in RHEL8 or CentOS 8 by chronyd.

How to find big files in Linux, Unix, AIX

How to enable VNC server (get GUI remotely) in CentOS 7, RHEL 7, CentOS 8 and RHEL 8 servers.

Remote X11 forwarding for AIX in command line.

How to manage Linux systems through web browser (cockpit for Linux): CentOS 7, CentOS 8, RHEL 7, RHEL 8, Fedora, Ubuntu and Debian systems.

YUM configuration in AIX.

Upgrade curl 7.29 to 7.69 in CentOS 7 or RedHat 7