In this blogpost we will see how can we change the time and time zone on Oracle Enterprise Linux 8 Server
Check the existing configure
time and time zone on Server:
[root@OEL8-Server1 ~]# date
Mon Mar 13 06:47:05 EDT 2023
[root@OEL8-Server1 ~]#
timedatectl
Local time: Mon 2023-03-13 06:47:46 EDT
Universal time: Mon 2023-03-13 10:47:46 UTC
RTC time: Mon 2023-03-13 10:47:48
Time zone: America/New_York (EDT, -0400)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
As you can see NTP service is
active it will not allow to change time manually.
[root@OEL8-Server1 ~]# timedatectl set-time 13:48:33
Failed to set time: NTP unit is active
Enable local time zone
update and disable NTP:
[root@OEL8-Server1 ~]# timedatectl set-local-rtc true
[root@OEL8-Server1 ~]# timedatectl set-ntp false
Set new time using timedatectl command:
[root@OEL8-Server1 ~]# timedatectl set-time 13:50:12
[root@OEL8-Server1 ~]# date
Mon Mar 13 13:50:14 EDT 2023
Change timezone:
Currently configure timezone is America/New_York (EDT, -0400). This has to be changed to Asia/Riyadh
This can be chaged again using the timedatectl command:
[root@S3T-IPEODBL1 ~]# timedatectl list-timezones | grep Riyadh
Asia/Riyadh
[root@S3T-IPEODBL1 ~]#
timedatectl set-timezone Asia/Riyadh
[root@S3T-IPEODBL1 ~]#
timedatectl
Local time: Mon 2023-03-13 20:52:05 +03
Universal time: Mon 2023-03-13 17:52:05 UTC
RTC time: Mon 2023-03-13 20:52:04
Time zone: Asia/Riyadh (+03, +0300)
System clock synchronized: no
NTP service: inactive
RTC in local TZ: yes
Done :)
Thanks for reading. Hope it
helps.
regards,
ZAHEER
Comments