linux synchronize hardware clock

Synchronize system and hardware clocks.

hwclock/clock command to view and set hardware time to view the system hardware clock hwclock --show

The hardware clock is synchronized with the system clock:

# hwclock --hctosys or # clock --hctosys hc represents the hardware time, sys represents the system time, that is, the hardware clock is used to synchronize the system clock

System clock and hardware clock synchronization:

# hwclock --systohc or # clock --systohc synchronize hardware clock with system clock

Set the system time zone:

vim /etc/sysconfig/clock

Set as:

ZONE="Asia/Shanghai"
UTC=true
ARC=false

Then execute:

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

ntpdate us.pool.ntp.org

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326555916&siteId=291194637