tom3f
Posts: 10
Joined: Thu Apr 26, 2012 6:26 pm

Raspbian remember last datetime even after i removed fake HW clock

Sat Nov 11, 2017 10:45 am

Hello,

I have raspberry Pi 3 with Raspbian Lite Strech. I use it with weewx software. For this purpose I need exact time. So I added to my weewx startup script waiting loop until datetime is actual. It looks like this:

Code: Select all

 while time.time() < 1509321600:
  time.sleep(0.5)
So this mean that after rPi is booted it will wait until datetime is higher than 10/30/2017. I assumed that after boot, time will be something like 1.1.1970 so after it get higher than 10/30/2017 it mean ntp set actual datetime. But even after I removed fake-hwclock (apt-get purge fake-hwclock) and installed ntpdate (apt-get install ntpdate). When I boot my rPi without network connected (i want to test if it forget time), there is still datetime like there was at shutdown. What I need to do to disable this ? How Is possible that raspberry after boot still remember time from before.


Please can you help me ? Thanks.

pcmanbob
Posts: 9441
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Raspbian remember last datetime even after i removed fake HW clock

Sat Nov 11, 2017 12:07 pm

May be you assumption that the time would default to 1.1.1970 is wrong and the default time is created when the original img file was created.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

tom3f
Posts: 10
Joined: Thu Apr 26, 2012 6:26 pm

Re: Raspbian remember last datetime even after i removed fake HW clock

Sat Nov 11, 2017 1:16 pm

Yes that may be true. But there is no default time but time from last shutdown. I shutdown my raspberry at 12:00 and I boot it now at 14:20. And when I check time on raspberry there is 12:02 so it remembers last time and date from previous shutdown. But I have no fake-hwclock installed. So it should be set to some default at boot.

tom3f
Posts: 10
Joined: Thu Apr 26, 2012 6:26 pm

Re: Raspbian remember last datetime even after i removed fake HW clock

Sun Nov 12, 2017 9:01 am

SOLVED:

There is no need for fake-hwclock or ntp service in debian (raspbian) strech. All this features are implemented in timedated / system-timedated. This is installed by default so even I disabled ntp and fake-hwclock my time was still preserved by this utility. I run sudo systemctl disable systemd-timesyncd and now is as I wanted.

Return to “Troubleshooting”