linux modify the system time synchronized network time

A, date command

date -s time changes to the system time clock time
Set the time and date
For example: the command system date set to June 8, 2018 in
命令 : "date -s 06/08/2018"
The system time is set to 22:46:03 commands
命令 : "date -s 10:46:03"
Two, hwclock command
hwclock / clock view, set the hardware time
View the system hardware clock
Set hardware time
 hwclock --set --date = "06/18/14 14:55" (month / day / year hours: minutes: seconds) or # clock --set --date = "06/18/14 14:55" (month / day / year hours: minutes: seconds)
Server Time Set
ntpdate time.nuri.net (if there are other time.nuri.net can not be used), such as:
time.nist.gov
0.asia.pool.ntp.org
1.asia.pool.ntp.org
2.asia.pool.ntp.org
3.asia.pool.ntp.org
Network time synchronization
Hardware clock and system clock synchronization:
# Hwclock --hctosys or # clock --hctosys hc represent hardware time, sys represents the system time, i.e., hardware clock synchronization with the system clock
System clock and the hardware clock synchronization:
# Hwclock --systohc or # clock --systohc i.e. hardware clock synchronized with the system clock

 
 

Guess you like

Origin www.cnblogs.com/xmao/p/12089340.html