3

The time and date of my pi with a clean install of raspbian running is very wrong. If I run date now, it tells me this: Thu May 7 01:39:43 2015. Neither the time or date is right.

I've tried to change the ntp servers, restart the time service, force sync, and now a clean reinstall, to no use.

I set time timezone to Oslo. Does anyone have any clue to what it could be?

ptf
  • 359
  • 1
  • 3
  • 10

1 Answers1

6

Did you

sudo service ntp stop
sudo ntpd -gq
sudo service ntp start

? (as already pointed out here.)

Output should look like this:

[ ok ] Stopping NTP server: ntpd.
ntpd: time slew +0.001411s
[ ok ] Starting NTP server: ntpd.

Note that it can be slow:

time ntpd -gq
ntpd: time slew -0.007043s

real    0m7.063s
user    0m0.040s
sys 0m0.020s

You can also double check you are not talking to nothing;

grep -P "^server" /etc/ntp.conf 
server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst
ping -c 1 0.debian.pool.ntp.org
PING 0.debian.pool.ntp.org (192.99.10.37) 56(84) bytes of data.
64 bytes from sexi.fawong.com (192.99.10.37): icmp_req=1 ttl=55 time=32.8 ms

--- 0.debian.pool.ntp.org ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 32.890/32.890/32.890/0.000 ms
user1133275
  • 2,216
  • 16
  • 32