I didn't tought of the possibility of the RTC being in local time and
having a offline backward change, obviously.
For similiar reasons you have the possibility of the user changing the
timezone under another OS.
I don't think using the compile time is required, and would introduce
a compile dependent behavior, I would prefer to use a magic number.
We could:
- Check for a known wrong date (I would select 2015-01-01 for the
magic number, since there is no advantage of using any other in the
past). If RTC<2015-01-01<driftfile, restore from driftfile.
- Check that the RTC is more in the past than what can be accounted
for DST or Timezone changes. If RTC<driftfile-26h, restore from
driftfile.
I would prefer the second since it avoids using the 2015 magic number,
as we can find in the future RTC defaulting to 2020, for example.
Since I don't see any negative effect, I wouldn't create additional
maintainer complexity with another option.
Thanks,
Nuno