Sunday 29 September 2019

How to change Hardware Clock date and time Using hwclock



The hardware clock also known as BIOS clock. It is independent operating system clock and it works even when shut down the system. hwclock utility is used to check current time of hardware clock and adjust the hardware clock time.

Step 1. Show the current hardware clock time: Run the one of the command from the below to check current hardware clock time:

[root@linuxcloudy ~]# hwclock --show
Sun 15 Sep 2019 11:05:06 AM IST  -1.022575 seconds
[root@linuxcloudy ~]#

[root@linuxcloudy ~]#  hwclock
Sun 15 Sep 2019 11:05:13 AM IST  -0.548982 seconds
[root@linuxcloudy ~]#

[root@linuxcloudy ~]#  hwclock -r
Sun 15 Sep 2019 11:05:13 AM IST  -0.548982 seconds
[root@linuxcloudy ~]#

Step 2: Adjust hardware clock time: Set the hardware clock time by entering manual time using --set option in hwclock command. Run the following command to set hardware clock time:

[root@linuxcloudy ~]# hwclock --set --date "10/29/2019 11:12:00"
[root@linuxcloudy ~]#

Set the hardware clock time from system time. Run the following command to set the time from current system time:

[root@linuxcloudy ~]# hwclock --systohc
[root@linuxcloudy ~]#

Step 3. Verification: Run the following command and verify the time setting:

[root@linuxcloudy ~]# hwclock --show
Sun 29 Sep 2019 12:43:24 PM IST  -0.116462 seconds
[root@linuxcloudy ~]#

[root@linuxcloudy ~]# hwclock
Sun 29 Sep 2019 12:43:28 PM IST  -0.476203 seconds
[root@linuxcloudy ~]#

[root@linuxcloudy ~]# hwclock -r
Sun 29 Sep 2019 12:43:31 PM IST  -0.678939 seconds
[root@linuxcloudy ~]#

Done!!! Hardware clock setting is done.

No comments:

Post a Comment