RHEL: Getting/Setting hardware clock’s time

RHEL: Getting/Setting hardware clock's time

# Tested on RHEL 6 & 7

# Just an extract from 'hwclock' man page

   hwclock -r or hwclock --show
   hwclock -w or hwclock --systohc
   hwclock -s or hwclock --hctosys
   hwclock --set --date=newdate


   --show Read  the Hardware Clock and print the time on Standard Output.  The time shown is always in local time, even if you keep your
      Hardware Clock in Coordinated Universal Time.  See the --utc option.

   --set  Set the Hardware Clock to the time given by the --date option.

   --hctosys
      Set the System Time from the Hardware Clock.

      Also set the kernel's timezone value to the local timezone as indicated by the TZ environment variable and/or /usr/share/zone-
      info, as tzset(3) would interpret them.  The obsolete tz_dsttime field of the kernel's timezone value is set to DST_NONE. (For
      details on what this field used to mean, see settimeofday(2).)

      This is a good option to use in one of the system startup scripts.

   --systohc
      Set the Hardware Clock to the current System Time.
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
6 rsync Examples to Exclude Multiple Files and Directories using exclude-from
Viewed 1767 times since Wed, Oct 31, 2018
Linux RAID Mdadm Cheat Sheet
Viewed 3038 times since Fri, May 15, 2020
RHCS6: Mirror/unmirror a GFS2 volume
Viewed 3865 times since Sun, Jun 3, 2018
ZFS: Snapshots and clones on zfs filesystems
Viewed 1811 times since Sun, Jun 3, 2018
Jak ustawić LVM, jak robić snapshoty oraz automatycznie powiększać LV, czyli małe howto
Viewed 2834 times since Sun, May 20, 2018
Logrotate Example for Custom Logs
Viewed 1438 times since Sun, Jan 12, 2020
Easily Monitor CPU Utilization in Linux Terminal With Stress Terminal UI
Viewed 1871 times since Thu, Apr 18, 2019
Telnet – Send GET/HEAD HTTP Request
Viewed 1350 times since Mon, Feb 18, 2019
Procedura powiekszania OCFS2 online
Viewed 4497 times since Fri, Jun 8, 2018
How to manage Linux password expiry with the chage command
Viewed 9888 times since Tue, Sep 11, 2018