- First install NTP:
1 Yum Install -y ntpdate
Then execute the NTP command:
1 time. windows.com
Or:
1 ntpdate cn.pool.ntp.org
If you want to be lazy and let the machine automatically calibrate the time, just add the command to cron.
1 crontab-e2 * */1 * * */sbin/ntpdate cn.pool.ntp.org #每隔一个小时同步一次
Save to exit.
- The server uses NTP update time, often involved in UTC whether the open problem, the time will be open for 8 hours
Before the following command, a command resolves all previous issues.
1 -S STDTIME.GOV.HK
Use Rdate to fetch the time of the STDTIME.GOV.HK server back and then write the hardware
1 Hwclock-W
The following is a description of how rdate commands are used
Feature Description: Displays the date and time of the other host.
Syntax: rdate [-ps][host name or IP address ...]
Additional instructions: Execute the rdate instruction, ask the other host for the system time and display it.
Parameters
-P Displays the date and time of the remote host.
-S returns the date and time received from the remote host to the local host's system time.
Linux Server Time Calibration method