Home>Article>Operation and Maintenance> Detailed explanation of hwclock command
hwclock Introduction
The hwclock command is used to set or read the system hardware clock. This clock is usually a battery-powered clock on the computer's motherboard.
Set the clock
To set the hardware clock, use the following syntax:
hwclock --set --date="MMDDhhmm[[[[cc]yy]]]"
Where:
For example, to To set the hardware clock to January 1, 2023, 12:00 AM, use the following command:
hwclock --set --date="010100002023"
Read Clock
To read the hardware clock, Just enter the following command:
hwclock
It will print the current clock value in your console.
Options
The hwclock command also provides the following options:
Example
To synchronize the hardware clock with the system clock, use the following command:
hwclock --systohc
To copy from filetimebackupTo restore the time of a previous backup, use the following command:
hwclock --restore --file=/path/to/timebackup
The above is the detailed content of Detailed explanation of hwclock command. For more information, please follow other related articles on the PHP Chinese website!