Keep the system clock and the RTC aligned to prevent drift and timestamp errors. 08.02.2026 | reading time: 2 min A desynchronized hardware clock produces wrong timestamps, confusing logs and scheduled jobs; this short guide shows how to align the RTC with the system clock using `hwclock` and `timedatectl` and when each tool is appropriate. A quick sync in action Copy the system time into the RTC and verify the change with this example session: ```bash $ date Thu Feb 8 12:34:56 UTC 2026 $ sudo hwclock --show 2026-02-08 11:59:10.000000+0000 $ sudo hwclock --systohc Hardware clock updated to 2026-02-08 12:34:56 $ sudo hwclock --show 2026-02-08 12:34:56.000000+0000 ``` UTC versus localtime and virtual machines Decide whether the RTC stores UTC or local time and set it with `timedatectl` when needed; use `timedatectl set-local-rtc 0` for UTC to avoid DST issues, remember VMs often rely on host time or paravirtualized time sources so syncing the guest RTC can be unnecessary or harmful, and preserve `/etc/adjtime` if you want hwclock to correct known drift. When to use hwclock, when to use timedatectl `hwclock --systohc` writes the current system time to the hardware clock and `hwclock --hctosys` does the reverse; `timedatectl` is the modern systemd-front end to enable NTP with `timedatectl set-ntp true` and to inspect RTC settings with `timedatectl status`—use hwclock for manual fixes and timedatectl/ntp clients for automatic maintenance. Practical maintenance and gotchas Keep the RTC battery healthy on physical machines, check for large offsets before syncing (avoid repeating incorrect writes), use the adjtime mechanism to compensate recurring drift, and on cloud instances prefer host-synchronized time or the hypervisor tools rather than repeatedly writing the guest RTC. Final encouragement Mastering time synchronization is a small but concrete step toward reliable systems; explore deeper by studying systemd time services and NTP clients, and consider pursuing certifications like CompTIA Linux+ or LPIC-1 with intensive exam preparation at bitsandbytes.academy to turn knowledge into career skills. Join Bits & Bytes Academy First class LINUX exam preparation. setup utilities boot-process infrastructure troubleshooting