1

Ok, I have this raspberry pi zero that's been running for most of a year now and I noticed a few weeks ago that the time was off by several hours. I did some digging and it just plain thinks that UTC time is 4 hours before what it should be.

I poke around the internets, and tried the items here to no avail. I found this post and my ntp.conf file is exactly the same (I ran diff on them to verify). I haven't tried setting the time explicitly with ntp -s... because I was under the impression that's what ntp is for?

I've set the timezone using the sudo dpkg-reconfigure tzdata command (and sudo raspi-config but those seem to get to the same menu with the same options). This results in the timezone being ok, but UTC is still off.

pi@raintree:~ $ date
Mon Sep 17 04:13:52 PDT 2018
pi@raintree:~ $ 
pi@raintree:~ $ date -u
Mon Sep 17 11:13:58 UTC 2018

Right now, that should show Mon Sep 17 15:13:58 UTC 2018. EDIT I am referencing https://time.is/UTC. Screen shot here.

ntpq seems to be ok.

pi@raintree:~ $ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 li290-38.member .INIT.          16 u    -   64    0    0.000    0.000   0.000
 PBX.cytranet.ne .INIT.          16 u    -   64    0    0.000    0.000   0.000
 ns1.backplanedn .INIT.          16 u    -   64    0    0.000    0.000   0.000
 195.21.152.161  .INIT.          16 u    -   64    0    0.000    0.000   0.000

Any ideas on where else to look?

Misc info:

pi@raintree:~ $ uname -a
Linux raintree 4.9.35+ #1014 Fri Jun 30 14:34:49 BST 2017 armv6l GNU/Linux
pi@raintree:~ $ 
pi@raintree:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 8.0 (jessie)
Release:    8.0
Codename:   jessie
  • if your local time at the moment was 04:13, then the UTC time is correct as PDT equals UTC-7. – kwasmich Sep 17 '18 at 15:33
  • Understood, which is why I posted the time it should say Mon Sep 17 15:13:58 UTC 2018. That is the "current" (at the time of the post) time in UTC. So it is 4 hours off. – nomadic_squirrel Sep 17 '18 at 16:38
  • What was your LOCAL time back then and what was your source for UTC? – kwasmich Sep 17 '18 at 17:01
  • Do you have another system that you can check UTC? – Seamus Sep 17 '18 at 17:15
  • I used https://time.is/UTC. I posted a screen shot here – nomadic_squirrel Sep 17 '18 at 17:29
1

ntp can't correct such a lapse. On boot, I run ntpdate before starting ntp, ntpdate can handle any correction.

  • Ah, interesting, I installed ntpdate, but when I ran it, I got 19 Sep 19:35:29 ntpdate[2676]: no servers can be used, exiting, I re-ran raspi-config and selected my timezone and now seem to be in a good place. I'm guessing having ntpdate allowed the raspi-config to properly set the date. – nomadic_squirrel Sep 19 '18 at 19:40
  • Oh, how are you starting ntpdate each boot? – nomadic_squirrel Sep 19 '18 at 19:41
  • I "tweaked" /etc/init.d/ntp, first thing in the start function is now ntpdate. – Gerard H. Pille Sep 19 '18 at 20:16
0

If the time on your Raspberry is off by hours with 0 minute, then I suspect it is a problem with your timezone setting. You already said that you had reconfigured your Rpi with a correct timezone using either dpkg-reconfigure tzdata and/or raspi-config. However, make sure the changes to just made did get updated in the /etc/timezone file.

  • Huh, my /etc/timezone file was not updated. I installed ntpdate per Gerard's post and it seems to have been updated after that. :shrug: – nomadic_squirrel Sep 19 '18 at 19:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.