I am running Home Assistant on the RPi4. Every time there is a power outage, the Pi restarts along with my router. My router takes longer to start than the Pi. This leads to the Pi failing to set the time using NTP. With every restart, the time is set many months in the past. This has to manually corrected by either restarting the pi and thus forcing the it to set the time with the now working NTP connection or setting it in the terminal manually.
Is there a way to automate this? Something in the lines of - if NTP time not equal to system time, then set system time as the NTP time.