> The hardware clock has a time, which is loaded into the system clock
> to initialize it.  That's it.  The only variable factor here is whether
> the hardware clock's time is in UTC or some local time zone.
>
> You can't do anything with drift at this point, because you don't actually
> know how long you were asleep.  All you know is the current HW clock time.

/etc/adjtime complements that info with the expected drift and the last
time the RTC was adjusted to the presumably correct time (which you'd
want to do every once in a while).
So by comparing the RTC time to the last-adjustment time you get to know
how much drift happened and you can correct this initial time estimate.

> It's not like you can say "Oh, I was asleep for 7.5234 hours, so I need
> to adjust the HW clock time forward by X seconds because I know it runs
> a bit slow."  That information is not available to you.

It is if /etc/adjtime is set properly when you go to sleep.
See `hwclock(8)` or `adjtime_config(5)`.


        Stefan

Reply via email to