Albretch Mueller wrote: > In case someone runs into the same problem, for some reason I can't > quite understand "sudo hwclock --set" wasn't working. Someone helped > me: > > https://manpages.debian.org/stretch/util-linux/hwclock.8.en.html > https://wiki.debian.org/DateTime > > and "date" worked! Which I has always taken to be a wrapper command to > hwclock! > > $ date > Sun 07 Aug 2022 01:35:45 PM UTC > > $ sudo date --set "2023-05-16 11:13:00 AM" > Tue 16 May 2023 11:13:00 AM UTC > > $ sudo hwclock --get > 2022-05-11 02:02:36.883165+00:00 > > $ sudo hwclock --systohc > > $ sudo hwclock --get > 2023-05-16 11:15:22.564093+00:00
Assuming you have network access close to boot time, you might want to run an NTP daemon to get the time from a selection of other servers. Debian runs a pool, which is configured by default in ntp-server and chrony, at least. -dsr-