Date and Time Configuration in RHEL7

Posted: 24 Feb 2018 in RHEL7
Tags: ,

Date and Time Configuration in RHEL7

This tutorial is all about date and time management in RHEL7 and CentOS7.I have mentioned step wise notes on how to see,change date and time in RHEL7 or Centos7. I have also mentioned about hardware clock and system clock along with NTP Server and vice versa. Basically this tutorial is all about every kind of time configuration along with date in RHEL7 and Centos7.

How to see Date and Time in RHEL7 or CentOS 7 in detail.


[root@localhost ~]# timedatectl
 Local time: Sat 2018-02-24 11:20:26 EST
 Universal time: Sat 2018-02-24 16:20:26 UTC
 RTC time: Sat 2018-02-24 16:20:29
 Time zone: America/New_York (EST, -0500)
 NTP enabled: yes
 NTP synchronized: yes
 RTC in local TZ: no
 DST active: no
 Last DST change: DST ended at
 Sun 2017-11-05 01:59:59 EDT
 Sun 2017-11-05 01:00:00 EST
 Next DST change: DST begins (the clock jumps one hour forward) at
 Sun 2018-03-11 01:59:59 EST
 Sun 2018-03-11 03:00:00 EDT
 [root@localhost ~]#

How to Change Current Time in RHEL7/CentOS7


[root@localhost ~]# timedatectl set-time 21:55:20

 

How to set the current date in RHEL7 and CentOS7


[root@localhost ~]# timedatectl set-date 2018:02:24

 

How  to set the local rtc in RHEL7 and CentOS7


[root@localhost ~]# timedatectl set-local-rtc yes

 

In Rhel 7 suppose you want to set the UTC, how will you do?


 [root@localhost ~]#  timedatectl set-local-rtc no

 

In Rhel 7 suppose you want to display the current date how will you do ?


 [root@localhost ~]# timedatectl set-time YYYY-MM-DD

 

How  to display the timezones in RHEL7 and CentOS7


[root@localhost ~]# timedatectl set-ntp yes

 

How to set the timezone in RHEL7/CentOS7


 [root@localhost ~]# timedatectl set-timezone timezone-name

 

How to synchronize the time with remote server in RHEL7/CentOS7


 [root@localhost ~]# timedatectl set-ntp yes

What if  you don’t want to synchronize the time with the remote server in RHEL7/CentOS7?


 [root@localhost ~]# timedatectl set-ntp no

 

How to synchronize the time from hardware clock to the system clock or vice versa in RHEL7 and CentOS7?


[root@localhost ~]# hwclock -s

[root@localhost ~]# hwclock -w

What is the name of the file where hardware clock information is stored inside RHEL7?


[root@localhost ~]# cat /etc/adjtime
 0.000000 1519491188 0.000000
 1519491188
 UTC

 

How to display the current hardware date and time in RHEL7 and CentOS7?


[root@localhost ~]# hwclock
 Sat 24 Feb 2018 11:54:00 AM EST -0.556452 seconds
 [root@localhost ~]#

 

How to set the hardware date and time in RHEL7 and Centos7?


[root@localhost ~]# hwclock --set --date “dd mmm yyyy HH:MM"

 

Advertisement

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.