Function Description: Displays and sets the hardware clock.
Syntax: Hwclock [--adjust][--debug][--directisa][--hctosys][--show][--systohc][--test]
[--UTC] [--version] [--set--date=< date and time;]
Added: There are two clocks such as hardware clock and system clock in Linux. The hardware clock is the clock device on the motherboard, which is usually the clock that can be set on the BIOS screen. The system clock refers to the clock in the kernel. When Linux starts, the system clock reads the settings of the hardware clock, and then the system clock runs independently. All Linux-related instructions and functions are programmed to read the system clock.
Parameters
--adjust Hwclock is recorded in the/etc/adjtime file each time the hardware clock is changed. The--adjust parameter allows the Hwclock to estimate the deviation of the hardware clock based on previous records and use it to correct the current hardware clock.
--DEBUG displays detailed information on Hwclock execution.
--directisa Hwclock presets To access hardware clocks from/DEV/RTC devices. If not accessible, this parameter can be used to access the hardware clock directly with the I/O instruction.
The--hctosys adjusts the system clock to match the current hardware clock.
--set--date=< Date and time > Set hardware clock.
--show Displays the time and date of the hardware clock.
The--SYSTOHC adjusts the hardware clock to coincide with the current system clock.
The--test only tests the program without actually changing the hardware clock.
--UTC to use GMT, add this parameter, and Hwclock will perform the work of the conversion.
--version Displays version information.
Before setting the system date and time, make sure that the operating system time is set appropriately.
The hardware time to be set depends on the operating system time, as follows:
[Email protected] ~]# hwclock--SYSTOHC
[Email protected] ~]# hwclock--SYSTOHC--UTC
Use Hwclock without any parameters to view the current hardware date and time.
[Email protected] ~]# hwclock
This article is from the "Dragon" blog, make sure to keep this source http://1208073155.blog.51cto.com/9039381/1433476