Tuesday, May 23, 2023

How to Set Timezone Using timedatectl Command in Linux ?

 Set Timezone Using timedatectl Command in Linux




Check current time and timezone details :


option:1

[root@0.0.0.0]#

[root@0.0.0.0]#

[root@0.0.0.0]#

[root@0.0.0.0]# timedatectl status

               Local time: Tue 2023-05-23 13:53:08 UTC

           Universal time: Tue 2023-05-23 13:53:08 UTC

                 RTC time: Tue 2023-05-23 13:53:09

                Time zone: UTC (UTC, +0000)

System clock synchronized: yes

              NTP service: active

          RTC in local TZ: no

[root@0.0.0.0]#

[root@0.0.0.0]#


Option:2 



[root@0.0.0.0]#

[root@0.0.0.0]# timedatectl

               Local time: Tue 2023-05-23 13:57:09 UTC

           Universal time: Tue 2023-05-23 13:57:09 UTC

                 RTC time: Tue 2023-05-23 13:57:10

                Time zone: UTC (UTC, +0000)

System clock synchronized: yes

              NTP service: active

          RTC in local TZ: no

[root@0.0.0.0]#






Get Timezone name using timedatectl:




[root@0.0.0.0]#

[root@0.0.0.0]#  timedatectl list-timezones | grep -i kolkata

Asia/Kolkata

[root@0.0.0.0]#






Set timezone using timedatectl command :


[root@0.0.0.0]#

[root@0.0.0.0]#

[root@0.0.0.0]# timedatectl set-timezone "Asia/Kolkata"

[root@0.0.0.0]#




Validate time and timezone 


[root@0.0.0.0]#

[root@0.0.0.0]# timedatectl

               Local time: Tue 2023-05-23 19:28:34 IST

           Universal time: Tue 2023-05-23 13:58:34 UTC

                 RTC time: Tue 2023-05-23 13:58:35

                Time zone: Asia/Kolkata (IST, +0530)

System clock synchronized: yes

              NTP service: active

          RTC in local TZ: no

[root@0.0.0.0]#

[root@0.0.0.0]#


No comments:

Post a Comment