real time clock / date

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
sky59sky59
Posts: 27
Joined: Fri Jan 06, 2017 11:11 pm
Location: Ausria/Slovakia

real time clock / date

Post by sky59sky59 »

How is the dietpi working?
I noticed, that before getting time from network it continues from last known date and time.
Is this information always somehow written to SD card? How often? Or writtne somewhere else?

thanx
User avatar
Fourdee
Site Admin
Posts: 2782
Joined: Tue Feb 06, 2007 1:36 pm

Re: real time clock / date

Post by Fourdee »

sky59sky59 wrote:How is the dietpi working?
I noticed, that before getting time from network it continues from last known date and time.
Is this information always somehow written to SD card? How often? Or writtne somewhere else?

thanx
Hi,

We use NTPD to obtain time sync. Runs during boot, and every day.

You can change this with:
dietpi-config > advanced options > Time sync mode
Untitled.png
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
sky59sky59
Posts: 27
Joined: Fri Jan 06, 2017 11:11 pm
Location: Ausria/Slovakia

Re: real time clock / date

Post by sky59sky59 »

thanx for the reaction, but this I know already...

my question is, if I do not provide network (so it can not have a time info) what is the Linux time then?

I already noticed (not sure) that in such case DietPi continues from last known date and time, this would mean it must write to SD (?)
card regularly (or olny during shut down) the time info?
User avatar
Fourdee
Site Admin
Posts: 2782
Joined: Tue Feb 06, 2007 1:36 pm

Re: real time clock / date

Post by Fourdee »

sky59sky59 wrote: my question is, if I do not provide network (so it can not have a time info) what is the Linux time then?
Time will stop on power off, time will resume on power on. Unless you have a RTC/network, it will always be incorrect, but, relative to the device.
I already noticed (not sure) that in such case DietPi continues from last known date and time, this would mean it must write to SD (?)
card regularly (or olny during shut down) the time info?
If you are using the default NTPD mode, once during boot, and once daily. 1/2 writes a day.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
sky59sky59
Posts: 27
Joined: Fri Jan 06, 2017 11:11 pm
Location: Ausria/Slovakia

Re: real time clock / date

Post by sky59sky59 »

>>Time will stop on power off, time will resume on power on. Unless you have a RTC/network, it will always be incorrect, but, relative to the device.

OK, it will be incorrect but never going back into the past ...... (?) /not sure what you mean "relative" /


Is it known, where (which file) is the time info kept on SD card?

Thanx!
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: real time clock / date

Post by k-plan »

sky59sky59 wrote:Is it known, where (which file) is the time info kept on SD card?

Code: Select all

 cat /etc/fake-hwclock.data
2017-04-14 10:17:02
sky59sky59 wrote:Is this information always somehow written to SD card? How often? Or writtne somewhere else?
https://packages.debian.org/jessie/fake-hwclock

http://www.forum-raspberrypi.de/Thread- ... er-uhrzeit
The location that the date is saved to is coded into the fake-hwclock script. You could change that, but it will get changed back if an upgrade installs a newer version.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
User avatar
Fourdee
Site Admin
Posts: 2782
Joined: Tue Feb 06, 2007 1:36 pm

Re: real time clock / date

Post by Fourdee »

sky59sky59 wrote: (?) /not sure what you mean "relative" /
As the device doesnt match with our knowledge of actual time, time is relative to the device, it doesn't know any different :)

You could say, it will have its own time, outside our time ;)
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Post Reply