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: , or whether you have the aptitude:

 aptitude install ntpdate 

You can find a list of servers ntp's the link:


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:

 00 **** ntpdate-u 

For the date command

This update can separate the date and time

Updating data

date-s 'yyyymmdd'

yyyy : the 4-digit year

mm : the 2-digit month

dd : the 2-digit day

Updating time

date-s 'hh: mm: ss'

hh : time from 00 to 23

mm : the 2-digit minute 00-59

ss : seconds with 2 digits 00-59

Written by vinicius