> > 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)`.
Yeah, except... you're assuming a workflow that is not real or reliable. hobbit:~$ ls -l /etc/adjtime -rw-r--r-- 1 root root 44 Mar 6 07:04 /etc/adjtime hobbit:~$ uptime 14:47:40 up 29 days, 2:54, 29 users, load average: 1.58, 1.07, 1.15 Nothing writes to /etc/adjtime on a regular basis. It's only written if you manually run an hwclock command, or if you change something (such as deciding to store your HW clock in UTC instead of local time, which is what I did on March 6 after learning that Debian had chosen local time when I installed). > It is if /etc/adjtime is set properly when you go to sleep. You cannot assume that adjtime was updated the last time your system stopped running, because your system might have stopped running due to a crash, instead of a controlled shutdown. All of the arguments that are being constructed here are bogus. The *only* thing you know at boot time is what's in the HW clock, and if you're really lucky, you'll be able to figure out what time zone it's allegedly set to (after reading /etc/adjtime from disk). hobbit:~$ cat /etc/adjtime 0.000000 1708191089 0.000000 1708191089 UTC hobbit:~$ date -d @1708191089 Sat Feb 17 12:31:29 EST 2024

