Time & NTP

Keeping Time in Sync

It's easy to assume a server's clock "just works," but hardware clocks drift over time - and accurate, synchronized time turns out to matter far more than it seems: log timestamps become useless for correlating events across servers if their clocks disagree, TLS certificates are validated partly by comparing the current time against their validity window, and authentication protocols like Kerberos reject requests if the clock skew between client and server is too large.

CommandPurpose
timedatectlShow/set time, zone, NTP status
timedatectl set-timezone Asia/KolkataSet timezone
timedatectl set-ntp trueEnable network time sync
chronyc sourceschrony NTP sources (RHEL)
date / hwclockSystem / hardware clock
$ timedatectl
               Local time: Mon 2025-01-06 10:00:00 IST
     System clock synchronized: yes
                   NTP service: active

That System clock synchronized: yes line is the actual health check to look for - it confirms the machine isn't just running some clock, but is actively keeping that clock aligned with a trusted external time source over the network (NTP, Network Time Protocol).

Tip: The daemon actually performing that synchronization has changed over the years - modern RHEL-family systems use chronyd, Ubuntu commonly uses the simpler built-in systemd-timesyncd, and the older, once-universal ntpd is now considered legacy on most distros. All three achieve the same underlying goal (a clock that tracks a trusted network time source), so don't be thrown off if a server you're troubleshooting uses a different one than you expected.