Instiq
Chapter 4 · Essential System Services·v1.0.0·Updated 7/6/2026·~11 min

What's changed: Initial version (topic 1.09, subtopics 1.09.1–1.09.3)

4.1Managing System Time

Key points

Learn to keep and synchronize system time: date and the hardware clock (hwclock), time zone configuration (/usr/share/zoneinfo/, /etc/localtime, /etc/timezone, TZ, tzselect, timedatectl), and NTP synchronization (ntpd, ntpdate, ntpq, chronyd, chronyc, pool.ntp.org).

Correlating logs, validating certificates, authentication—accurate time underpins everything. Linux keeps two clocks (the OS-maintained system clock and the motherboard's hardware clock), and the standard practice aligns them to internet time sources via NTP.

4.1.1The two clocks and time zones

  • date shows/sets the system clock (date, formatted date +%Y-%m-%d). hwclock reads/syncs the hardware clock (hwclock --systohc writes system→hardware; --hctosys the reverse).
  • Time zones live as files under /usr/share/zoneinfo/; configuration means symlinking /etc/localtime to one (Debian family also records the name in /etc/timezone).
  • Set with timedatectl (the systemd-era integrated tool: timedatectl set-timezone Asia/Tokyo, plus status), pick interactively with tzselect, or switch temporarily via the TZ variable (TZ=UTC date).

Continue reading — free sign-up

You're reading the free preview. Sign up free to read this section in full, plus every chapter (including 4+) and all questions.