Wrong time after power off/on

I am using a raspberryPi as a webserver for my application, that should be disconnected and reconnected from the power supply on a regular basis.
However, after the Pi is turned on again my services seem to have the wrong time.

How to solve this issue?

Hi, did you already take a look at our docs reference for time management?

There are certain networking requirements to ensure that the NTP service can properly function and the device time may be kept synchronized.

Am I right in assuming that this section in the docs is stating that there is no way to keep the time synchronized to the actual time, if there is no network connection available at startup?


Yes, unfortunately the Pi does not have a Real Time Clock, and so requires a network connection to synchronize current time with an NTP sever when it is powered on (specifically UDP port 123). If no connection is available immediately at startup synchronization should happen automatically once a connection becomes available later.