2

I'm using a Raspberry 1B and I have reset the timezone with

sudo dpkg-reconfigure tzdata

I want to use Europe/Paris. It say it works correctly, the time is said to be CEST but it is totally wrong I should have 18:44 (or 6:44pm but I wish to have 18:44) but I have 3:24 right now...

I have tried to change the NTP server but it does nothing. What should I check and do?

Here is my /etc/network/interfaces :

auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet dhcp
wireless-essid myssid
wireless-mode managed

I have tried with Wi-fi and with Ethernet on boot.

Julien Kosinski
  • 21
  • 1
  • 1
  • 4

3 Answers3

4

I have noticed that for ntp to work correctly, the Pi needs to have a working internet connection from boot onwards. When I connected the Pi to a WiFi network after boot, it would not refresh the date/time on the Pi and basically start with the time as it was when the Pi was last shut down. I recommend you try restarting your Pi after you have configured the network to autoconnect to either Ethernet or a known WiFi network.

Phil B.
  • 5,053
  • 17
  • 30
4

There may be two issues going on here: NTP and timezone misconfiguration.

Check that the NTP daemon is running:

ps auxwww | grep ntp

If it is installed and running verify that it is in sync:

ntpq -p | egrep "^\*|jitter"

It should show that it's in sync with a remote server. For example:

$ ntpq -p | egrep "^\*|jitter"
     remote           refid      st t when poll reach   delay   offset  jitter
*gatekeeper.tss. 204.123.2.72     2 u   10   64    3   42.324    5.973   1.017 

If ntp isn't installed install it and make sure it's running:

apt-get install ntp
service ntp start

After the daemon is started it will take a while for it to get in sync with a remote server, so wait a few minutes before checking it with ntpq -p


If you still have issues with it displaying the wrong time zone:

Verify '/etc/localtime' has the correct data:

ls -la /etc/localtime
ls -la /usr/share/zoneinfo/Europe/Paris

or

md5sum /etc/localtime
md5sum /usr/share/zoneinfo/Europe/Paris

If they don't match replace it:

cp -p /usr/share/zoneinfo/Europe/Paris /etc/localtime

Then verify with the date command that the correct timezone is set.

Gene
  • 186
  • 4
3

To overcome the problem of time synchronisation not working when you don't have an internet connection at boottime, just let the device boot then go to the terminal (SSH or something similar) then type at the prompt:
sudo sntp -s [timeserver]
where in the above command [timeserver] is the address of a timeserver.
Remember: if the timedifference between the actual time and the time the RPi is set to is too big then NTP just refuses to synchronize the time, this could also be the problem in your case. The command mentioned above will synchronize no matter how big the difference is.

wie5Ooma
  • 296
  • 1
  • 3
  • 11