Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Date / Time

Direct 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.

When to use this

Use it to check or set the time, or when time jumps after reboot.

First 30 seconds

1. timedatectl — local, UTC and RTC times.

2. NTP active? If not, enable: timedatectl set-ntp true.

3. Manual set only without NTP: timedatectl set-time 'YYYY-MM-DD hh:mm:ss'.

4. After reboot wrong → hwclock --systohc and check the RTC battery.

5. Compare with another host: date -u.

Operational verification

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

Evidence · next step

For Time & NTP → Date / Time, continue with the first unproven Topic check: Record local time with numeric UTC offset, UTC time, uptime/monotonic context and boot time for the incident. If that boundary is healthy, advance to the adjacent check: Inspect synchronization state plus RTC/local-RTC configuration and virtualization clock source assumptions before manual intervention. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it to check or set the time, or when time jumps after reboot.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

clocksource/RTC → kernel timekeeping → system wall clock → UTC/local presentation → synchronization correction → application timestamp/timer use → workload

Healthy evidence: wall clock, UTC conversion and monotonic progression are coherent, RTC/virtualization assumptions are known, corrections are stable and the time-sensitive workload succeeds.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Record local time with numeric UTC offset, UTC time, uptime/monotonic context and boot time for the incident.

  • Inspect synchronization state plus RTC/local-RTC configuration and virtualization clock source assumptions before manual intervention.
  • Search logs for time jumps, suspend/resume, boot, migration and synchronization corrections; correlate application timestamps explicitly.
  • After correction, verify stable progression over time and repeat the original time-sensitive operation rather than checking only one displayed timestamp.

Verification chain. clocksource/RTC → kernel timekeeping → system wall clock → UTC/local presentation → synchronization correction → application timestamp/timer use → workload

Step 3 Commands Verify boundary
date
date -u
date -d '2026-11-03 10:00 UTC' +%s
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: time jumps, repeated manual corrections, wrong RTC mode, guest/host clock fights, apparent local-time error with correct UTC, or application timers disagree after a clock step.

Step 5 Common mistakes Narrow the fault
  • Comparing logs from hosts in different time zones without UTC.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

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.

Key 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
ReferenceWhat it is1 section · depth on demand

Core model

Capture current wall-clock with explicit offset/zone plus UTC and monotonic/uptime context. Determine whether the symptom concerns displayed local time, actual system-clock error or elapsed-time measurement. Check RTC/virtualization relationships and recent clock-change events before manually setting time, because a step can affect schedulers, logs, leases, TLS/Kerberos and application timers.

ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

Date/time correctness is confirmed only for a defined clock basis and interval; one correct display does not show source health, historical correctness or application behavior.

In depth

Setting and displaying date and time

On systems with network time synchronisation, the clock is normally never set by hand. The timedatectl(1) manual page describes set-time, which sets both the system clock and the RTC, and set-ntp, which turns synchronisation on or off. Setting the time manually only makes sense with NTP turned off, for example on isolated systems, or in a lab to test date-dependent behaviour.

Displaying time

CommandOutput
dateLocal time in the default format
date -uUTC
date -Is / date --iso-8601=seconds2026-11-28T14:40:02+01:00
date +%sSeconds since 1970-01-01 UTC (epoch)
date -d @1795873202Convert an epoch value
date -d "next friday 09:00"Relative dates
TZ=America/New_York dateTime in another zone

Format codes

CodeMeaningCodeMeaning
%F2026-11-28%T14:40:02
%Y%m%d20261128%H%M1440
%z+0100%ZCET
%sEpoch%uDay of week (1 = Monday)

Clocks in the system

ClockNotes
System clock (realtime)What date shows; can be stepped
Monotonic clockNever jumps; used for timeouts and timers
Hardware clock (RTC)Battery-backed; read at boot (hwclock)

Changing the clock manually

StepCommand
Disable NTPtimedatectl set-ntp false
Set the timetimedatectl set-time "2026-11-28 14:45:00"
Re-enable NTPtimedatectl set-ntp true
host$ date -Is; date -u +%FT%TZ
2026-11-28T14:40:02+01:00
2026-11-28T13:40:02Z
host$ date +%s
1795873202
host$ date -d @1795873202 -u
Sat Nov 28 13:40:02 UTC 2026
host$ backup="db-$(date +%F_%H%M).sql.gz"; echo "$backup"
db-2026-11-28_1440.sql.gz
host$ date -d "2026-11-28 14:00 CET + 90 minutes" +%T
15:30:00
host$ sudo timedatectl set-ntp false && sudo timedatectl set-time "2026-12-31 23:59:00" && sudo timedatectl set-ntp true

Time stamps in file names and logs

%F_%H%M sorts correctly as text, and contains no characters that cause trouble in file names. In logs and APIs, ISO 8601 with an offset (date -Is), or UTC with Z, removes any doubt about the time zone.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

Date / Time is part of Time & NTP → Date / Time. Date / Time covers the Linux system clock as observed in UTC/local presentation, the distinction between wall-clock and monotonic time, RTC interaction and the operational consequences of stepping or slewing the clock.

Topic-specific state model. Date / Time covers the Linux system clock as observed in UTC/local presentation, the distinction between wall-clock and monotonic time, RTC interaction and the operational consequences of stepping or slewing the clock.

Interpretation rule. - date looks correct ≠ the clock source or synchronization discipline is healthy.

  • Wall-clock time ≠ monotonic elapsed time; wall time can step while monotonic clocks normally do not.
  • Manual date change fixes display ≠ underlying NTP/RTC/VM clock conflict is resolved.
  • RTC time ≠ necessarily local time; Linux commonly treats hardware clock as UTC and converts presentation separately.

Quick reference

Date and time commands:

date; date -u; date -Iseconds
date +%s                              # epoch seconds
date -d @1793923200                    # epoch → date
date -d 'next monday 09:00'
date -d '2026-11-05 12:00 UTC' +'%F %T %Z' 
timedatectl set-time '2026-11-05 12:00:00'    # only with NTP disabled

Use ISO 8601 and UTC in logs and scripts (date -u +%FT%TZ); local time with DST changes creates ambiguous or missing hours.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. Date/time correctness is confirmed only for a defined clock basis and interval; one correct display does not show source health, historical correctness or application behavior.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. Date / Time owns Linux system-clock and wall/monotonic distinctions. Time Zones owns presentation rules; NTP/chrony own network discipline; hardware/virtualization owns underlying clock devices.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Time & NTP → Date / Time. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://chrony-project.org/documentation.html · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
linux date timesystem clock linuxwall clock monotonic linuxhardware clock linux
Embedded reference data

Quick lookup tables

Date / Time operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for Date / Time.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateDate / Time covers the Linux system clock as observed in UTC/local presentation, the distinction between wall-clock and monotonic time, RTC interaction and the operational consequences of stepping or slewing the clock.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin exact symptom + clock/trigger time → identify authoritative scheduler or time daemon → read back effective configuration/runtime state → reproduce or observe the expected event/source measurement → correlate identity/environment/offset/status with logs → change one demonstrated cause → read back stable state → repeat original scheduled or time-sensitive workload + regression check.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainclocksource/RTC → kernel timekeeping → system wall clock → UTC/local presentation → synchronization correction → application timestamp/timer use → workloadTrace requested/configured state through effective state to the observed workload result.
Failure boundaryDate/time correctness is proven only for a defined clock basis and interval; one correct display does not prove source health, historical correctness or application behavior.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux scheduling/time evidence can establish this proof path: clocksource/RTC → kernel timekeeping → system wall clock → UTC/local presentation → synchronization correction → application timestamp/timer use → workloadUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured host, clock/timezone, scheduler or time-daemon instance, identity/environment, source, trigger/measurement interval or workload scope. Date/time correctness is proven only for a defined clock basis and interval; one correct display does not prove source health, historical correctness or application behavior.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven scheduling/time boundary: preserve the original timing and execution/source context, capture the adjacent scheduler/process or clock/source state, change only the demonstrated cause, then repeat the original scheduled or time-sensitive workload and regression checks.Continue to the next unresolved boundary while preserving the original test condition.

Date / Time · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryDate / Time
Topic pathTime & NTP → Date / Time
Runtime stateDate / Time covers the Linux system clock as observed in UTC/local presentation, the distinction between wall-clock and monotonic time, RTC interaction and the operational consequences of stepping or slewing the clock.
Fast checks- Record local time with numeric UTC offset, UTC time, uptime/monotonic context and boot time for the incident. - Inspect synchronization state plus RTC/local-RTC configuration and virtualization clock source assumptions before manual intervention. - Search logs for time jumps, suspend/resume, boot, migration and synchronization corrections; correlate application timestamps explicitly. - After correction, verify stable progression over time and repeat the original time-sensitive operation rather than checking only one displayed timestamp.
Verification chainclocksource/RTC → kernel timekeeping → system wall clock → UTC/local presentation → synchronization correction → application timestamp/timer use → workload Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary.
Failure boundaryDate/time correctness is proven only for a defined clock basis and interval; one correct display does not prove source health, historical correctness or application behavior. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?