First you need to install rdate package.
For Debian :
apt-get install rdate
For CentOS :
yum install rdate
After installing the rdate package , install a new cron job to be run daily to synchronize your machine time and date.
crontab -e
and enter the following line into the cron file :
0 0 * * * /usr/bin/rdate -s time-nw.nist.gov && /sbin/hwclock --systohc