2

The Raspberry Pi has no battery powered hardware clock, so it needs to fetch time via NTP and store it via fake-hwclock to not start at 1970 again after a power-loss. When the device is running the CPU keeps track of time.

How is "running" defined here?

Examples of what I mean follow. When I do

sudo reboot

where the CPU does not power down, does the clock stop for some seconds or does it even get reset? When I do

sudo shutdown -h now

but do not pull the power cord (PWR LED still on), does the clock continue running or does it stop or does it reset?

2

If you shut down properly, the time is saved and reloaded on next boot. On reboot you should only lose a few seconds if no NTP is available.

  • So, the time is only running when the operating system is actually running? CPU having power, but no operating system running, is not enough? – Foo Bar May 21 '14 at 8:14
  • 2
    I haven't actually checked the Raspbian code, but the clock on most computer systems is driven by a periodic interrupt which increments a counter. Without an OS to service the interrupts nothing happens. – Milliways May 21 '14 at 9:43

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.