How-To Set the Time to be Synchronized in CentOS / Linux?

Monday, 3rd December 2012

First, we will install NTP Daemon which will keep the server time in sync continuously.

yum install ntp
chkconfig ntpd on

Then, we will set the time for the first time from the command prompt.

Then, we will start the NTP daemon to keep the time in sync continuously.
/etc/init.d/ntpd start

Then, we will sync the current date / time to the server's hardware clock.
This can be done as follows:

hwclock --systohc

Please note that to check your current date, you simply need to execute the 'date' command