From ntpdate's man page: "Force the time to be stepped using the settimeofday() system call, rather than slewed (default) using the adjtime() system call.This option should be used when called from a startup file at boot time." Many of the answers below do not include it, and that maybe part of the problem in getting things to work.The result of ntpq -p: remote refid st t when poll reach delay offset jitter ============================================================================== sola-dal-09126.96.36.199 2 u 33 64 1 70.629 -4146.9 0.001 ntp1. Be 188.8.131.52 3 u 32 64 1 63.629 -4158.7 0.001 247.216.218.254.202 2 u 31 64 1 70.431 -4163.3 0.001 helium.constant 184.108.40.206 2 u 30 64 1 102.066 -4179.0 0.001 europium.canoni 1.14 2 u 29 64 1 171.013 -4187.2 0.001Note: -q switch should update the time. The second thing I would check is services: server 0org iburst server 1org iburst server 2org iburst server 3org iburst restrict default nomodify nopeer restrict 127.0.0.1 restrict ::1 driftfile /var/lib/ntp/ntp.drift logfile /var/log/..Pretty sure ntpupdate is more or less depreciated depending on what version of ntp you are running. step_systime: step -191.185220 residual 0.000000 In ntp_set_tod ntp_set_tod: clock_settime: 0: Success ntp_set_tod: Final result: clock_settime: 0: Success addto_syslog: ntpd: time set -191.185220 s ntpd: time set -191.185220s filegen 2 3552675327 0 3552595200driftfile /var/lib/ntp/ntp.drift statistics loopstats peerstats clockstats filegen loopstats file loopstats type day enable filegen peerstats file peerstats type day enable filegen clockstats file clockstats type day enable server 0.server 1.server 2.server 3.server ntp.restrict -4 default kod notrap nomodify nopeer noquery restrict -6 default kod notrap nomodify nopeer noquery The -q switch is what sets the time.For longer term, you should simply configure the NTP daemon to be running always.This answer should go to the top, because it is correct: ntpdate is deprecated and installing it is a bad idea, because it conflicts with ntp.Please consider joining the # pool: server 0.iburst server 1.iburst server 2.iburst server 3.iburst # Access control configuration; see /usr/share/doc/ntp-doc/html/for # details. # # Note that "restrict" applies to both servers and clients, so a configuration # that might be intended to block requests from certain clients could also end # up blocking replies from your own upstream servers.
I added the following line to $ date ; sudo service ntp stop ; sudo ntpdate -s gov ; sudo service ntp start ; date Thu Jan 1 UTC 1970 * Stopping NTP server ntpd [ OK ] * Starting NTP server [ OK ] Thu Feb 14 UTC 2013 notice the '-b' flag on ntpdate.
Yesterday I noticed that the rpi time was wrong (after a short power failure).
I started digging and found out that the NTPd service is not updating the local time.
The Raspberry Pi does not have a RTC (Real Time Clock) module and it is not able to keep the date and time without a power source.
If your Raspberry Pi is not connected to the Internet, you are out of luck and the only option is to buy and install an RTC module.