Time zones and synchronization
Quick answer
UTC describes a common time reference; a time zone determines local display and calendar rules. Clock synchronization keeps the system clock aligned with a reference, independently of display settings.
Prepare the practice environment
Run python3 lab-fixtures/logs-time/setup.py from the extracted package root as an ordinary user. Enter the printed path and check pwd. Use a fresh fixture and Bash with LC_ALL=C and set -o pipefail for each example. Never install the sample schedules, change system time or use the global logrotate configuration. Manual inspection requires an authorized disposable VM.
How it works
GNU date -d parses a supplied instant; -u displays UTC. A temporary TZ assignment changes only the command environment. Local offsets can change with daylight saving rules; use named zones and explicit timestamps. The realtime clock can jump after correction, while a monotonic clock is useful for elapsed intervals. timedatectl status inspects system time configuration; timesync-status is specific to systemd-timesyncd. On chrony systems chronyc tracking and sources inspect synchronization, not just whether a daemon runs. The lab never sets the clock or contacts an NTP server.
Two representations of one instant can show different hours while producing the same Unix timestamp with date +%s for the supplied instant. Local times during daylight-saving transitions may be skipped or repeated; include an explicit offset or UTC when recording incident times. A clock synchronization status and a display timezone answer different questions. Do not change either setting during this read-only exercise.
Try the examples
Epoch zero is a fixed test input, not the current time.
Expected stdout:
1970-01-01 00:00:00 UTCTZ=Europe/Stockholm date -d '2025-01-15 12:00:00 UTC' '+%H:%M %z'TZ=Europe/Stockholm date -d '2025-07-15 12:00:00 UTC' '+%H:%M %z'These fixed dates illustrate seasonal offsets in the installed timezone database.
Expected stdout:
13:00 +010014:00 +0200Read-only in a systemd VM. A service being active is not proof of synchronization.
Manual example; not executed locally. Follow its stated environment restrictions.
Common mistakes
Do not use date -s or timedatectl set-time for a formatting exercise. Do not equate time zone selection with NTP synchronization.
Practice
Format the same fixed UTC instant in UTC and Europe/Stockholm; explain why the epoch value does not change.
Related references
Study: date, timedatectl, chronyc. These are reference names, not deployed links.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Time zones and synchronization — Knowledge Check
Apply log, clock and scheduling concepts to private fixtures and VM-only scenarios.
What does TZ change for date?
What measures elapsed intervals robustly against wall-clock adjustments?
What does chronyc tracking inspect?
Does changing timezone synchronize the clock?