There are at least two ways to synchronize time under Linux:
Rdate,ntpdate two kinds. CentOS minimized installation is not installed by default, first verify that it has been installed, or install it first.
Where Rdate itself is used to obtain time on the remote time server, with the-s parameter, you can apply the acquired time to the local system.
NAME
Rdate-get the time via the network
Synopsis
Rdate [-P] [-S] [-u] [-l] [-t sec] [host ...]
DESCRIPTION
Rdate connects to an RFC 868 time server over a TCP/IP network, printing the returned time
and/or setting the system clock.
OPTIONS
-P Print The time returned by the remote.
-S Set the system time to the returned time.
-U use UDP instead of TCP as the transport.
-l use Syslog to output errors (cron.warning) and output (Cron.info).
-T Set timeout in seconds for every attempt to retreive date.
rdate-s time.nist.gov
Ntpdate itself is the tool used to synchronize time.
Example: Ntpdate ntp.sjtu.edu.cn
NAME
Ntpdate-set the date and time via NTP
Disclaimer:the functionality of this program are now available on the NTPD program. See The-q com-
Mand line option in the Ntpd-network time Protocol (NTP) daemon page. After a suitable period of
Mourning, the Ntpdate program was to being retired from this distribution
Synopsis
ntpdate [ -46BBDQSUV] [-a key] [-e Authdelay] [-K keyfile] [-o version] [-p samples] [-t
Timeout] [-u user_name] server [...]
DESCRIPTION
[Refer to the Linux Man manual for details]
Date Time Server
Synchronization time, you must have a time server. Normally, we don't have to build it ourselves, we can use the public time service.
See common NTP server addresses and IP http://www.douban.com/note/171309770/in China
One of the national timing centers seems to be useless., we recommend using the Shanghai Jiaotong University NTP service ntp.sjtu.edu.cn or American Timing Center time.nist.gov
Rdate-s time.nist.gov
Ntpdate ntp.sjtu.edu.cn
Can be added to the crontab timing execution.
This article is from the "Boyhack" blog, make sure to keep this source http://461205160.blog.51cto.com/274918/1759840
Linux time-of-day automatic Sync settings (rdate,ntpdate two methods)