Pcornel
Linux · Time & NTP

Date / Time

Cheat sheet · https://pcornel.dk/topic.php?topic=2830

Back to the Topic

Answer

date shows or sets the system time; timedatectl shows time, time zone, RTC and whether NTP sync is active. hwclock reads and writes the hardware clock.

Remember

Do not set the time by hand while NTP is active — it will be corrected. Time jumping after reboot means a bad RTC or an RTC set in local time; write the synchronised time with hwclock --systohc.

First checks

  • timedatectl — time, time zone and sync status
  • chronyc tracking — offset and source (chrony)
  • chronyc sources -v — time sources and reachability
  • date -u — UTC time

Verify in this order

system clock (kernel) ← NTP adjustments → written to RTC → read from RTC at boot

Where it usually breaks

First mismatch in persistent intent → provider/parser/generator → kernel/userspace runtime → dependency/security context → logs/counters → consumer-visible read-back; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2830

Confirmation

Confirm action

Continue?