$ date ; sudo service ntp stop ; sudo ntpdate -s time.nist.gov ; sudo service ntp start ; dateThu Jan 1 00:00:58 UTC 1970 * Stopping NTP server ntpd [ OK ] * Starting NTP server [ OK ] Thu Feb 14 18:52:21 UTC 2013
USAGE sntp ntpserver.somewhere is the simplest use of this program and can be run as an unprivileged command to check the current time and error in the local clock. sntp -Ss -M 128 ntpserver.somewhere With suitable privilege, run as a command or from a cron(8) job, sntp -Ss -M 128 ntpserver.somewhere will request the time from the server, and if that server reports that it is synchronized then if the offset adjustment is less than 128 milliseconds the correction will be slewed, and if the correction is more than 128 milliseconds the correction will be stepped. sntp -S ntpserver.somewhere With suitable privilege, run as a command or from a cron(8) job, sntp -S ntpserver.somewhere will set (step) the local clock from a synchronized specified server, like the (dep‐ recated) ntpdate(8), or rdate(8) commands.
# apt-get install fake-hwclockfake-hwclock: Save/restore system clock on machines without working RTC hardware Some machines don't have a working realtime clock (RTC) unit, or no driver for the hardware that does exist. fake-hwclock is a simple set of scripts to save the kernel's current clock periodically (including at shutdown) and restore it at boot so that the system clock keeps at least close to realtime. This will stop some of the problems that may be caused by a system believing it has travelled in time back to 1970, such as needing to perform filesystem checks at every boot. On top of this, use of NTP is still recommended to deal with the fake clock "drifting" while the hardware is halted or rebooting.