Detect and neutralize bogus RTC values
Seems like our RTC likes to come up with bogus values after getting reset, resulting in a system date set far in the future which breaks NTP, TLS, DHCP and likely plenty of other things as well.
It appears that the RTC should be able to tell us whether the value it holds can be considered valid or not:
4.7. OSCILLATOR STOP DETECTION If the oscillator fail (OF) bit is internally set to a “1”, this indicates that the oscillator has either stopped, or was stopped for some period of time and can be used to judge the validity of the clock and date data. This bit will be set to “1” any time the oscillator stops.
(https://www.microcrystal.com/fileadmin/Media/Products/RTC/App.Manual/RV-4162-C7_App-Manual.pdf)
It's probably a good idea to ignore the value in such case and treat the RTC as uninitialized, which will then allow the OS to set the time via NTP.