There are several ways of update date and time in linux , among which the simplest are:

For server

Easier however, there is the need to have internet connection, and ntpdate installed.

If you do not have ntpdate installed you can install from source: http://www.ntp.org/downloads.html , or whether you have the aptitude:

You can find a list of servers ntp's the link: http://support.ntp.org/bin/view/Servers/NTPPoolServers

Logical disjunction

also can use the ip national observatory :

We can also put the script in cron to be checked hourly.

and put the code:

For the date command

This update can separate the date and time

Updating data

yyyy : the 4-digit year

mm : the 2-digit month

dd : the 2-digit day

Updating time

hh : time from 00 to 23

mm : the 2-digit minute 00-59

ss : seconds with 2 digits 00-59

Written by vinicius