NTP Date

NTP is Network Time Protocol. This is used for syncing a OS to a time server.

In Linux you'd type:
ntpdate time-nw.nist.gov
if you get an error that is doesnt know the command you will need to install ntp
yum -y install ntp
or
apt-get install ntp


In Windows there is not a direct executable. however you can:
Click on your clock in your task bar
click change time date
Click the Internet Time tab.
you will see an Update now button.

 

For Automation of set time through a cron job:

 

Update the server time ever hour at :30 and send an email

30 * * * * ntpdate time-nw.nist.gov

 

Update the server time ever hour at :30 and send no email

30 * * * * /usr/sbin/ntpdate time-nw.nist.gov > /dev/null 2>&1

 

 

Update the server time ever hour at :30 and send email if error

30 * * * * /usr/sbin/ntpdate time-nw.nist.gov  > /dev/null

 

Setting the timezone CentOS:

 

Find you time zone file: cd /usr/share/zoneinfo
mv /etc/localtime /etc/localtime.bak
ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime