In Linux, there are two kinds of clocks, such as hardware clock and system clock. The hardware clock refers to the clock device on the motherboard, which is usually the clock set in the BIOS screen. The system clock refers to the clock in the kernel. When Linux starts, the system clock reads the hardware clock setting, and the system clock is operated independently. All Linux related instructions and functions are set to read the system clock.
Grammar
Hwclock [--adjust][--debug][--directisa][--hctosys][--show][--systohc][--test] [--UTC]
[--version] [--set--date=< Date and time]
Parameters:
- --adjust Hwclock each time the hardware clock is changed, it is recorded in the/etc/adjtime file. The--adjust parameter allows the Hwclock to estimate the hardware clock deviation based on previous records and use it to correct the current hardware clock.
- --DEBUG displays detailed information when Hwclock executes.
- --directisa hwclock preset To access hardware clocks from/DEV/RTC devices. If it is not accessible, this parameter can be used to access the hardware clock directly with the I/O instruction.
- --hctosys adjusts the system clock to match the current hardware clock.
- --set--date=< Date and time > Set hardware clock.
- --show the time and date when the hardware clock is displayed.
- --SYSTOHC adjusts the hardware clock to match the current system clock.
- --test only tests the program and does not actually change the hardware clock.
- --UTC to use GMT, add this parameter, Hwclock will perform the conversion work.
- --version Displays version information.
Instance
Show Current Time
# Hwclock
May 27, 2010 Thursday 18:04 31 sec -0.704214 seconds
View version Information
# hwclock-v
Hwclock from UTIL-LINUX-2.12A