You can use the ntpdate command. The ntpdate command sets the date and time using Network Time Protocol (NTP), setting the local date and time by polling a specified NTP server that determines the correct time. It obtains a number of samples from each server specified and applies standard NTP clock filters and selection algorithms to select the best samples.
Command format: ntpdate time server.
1. Install ntpdate and execute the following command
yum install ntpdate -y
2. Manually synchronize network time
ntpdate command:
ntpdate -u 210.72.145.44: Network Time synchronization command
Note: If the -u parameter is not added, the following prompt will appear: no server suitable for synchronization found
-u: It can be seen from man ntpdate that the -u parameter can Synchronize with the host across the firewall;
210.72.145.44: The official server of China National Time Service Center.
NTP commonly used server:
China National Time Service Center: 210.72.145.44
NTP server (Shanghai): ntp.api.bz
United States: time .nist.gov
Fudan: ntp.fudan.edu.cn
Microsoft Corporation Time Service Host (USA): time.windows.com
Taiwan Police University Time Service Center ( Taiwan): asia.pool.ntp.org
The above is the detailed content of linux synchronization time command. For more information, please follow other related articles on the PHP Chinese website!