Time
Single-page view · as markdown
Keeping the Time
Peios / Using Peios / Time
timed keeps the machine clock aligned with network time sources. Certificate validation, authentication, and the ordering of records depend on that clock. A time zone changes how programs display time; it does not correct the clock.
The service compares measurements from several sources, rejects conflicting measurements, and adjusts the clock's rate. Its reported accuracy estimates uncertainty from those measurements. It is not independent proof of the time.
Sources are not trusted individually #
Each server supplies an interval in which it estimates the true time lies. timed selects an overlapping set and rejects sources outside that agreement. A rejected source is called a falseticker.
Three sources with independent failure modes can let an agreeing majority exclude one incorrect source. One source has no independent comparison. Two disagreeing sources do not establish which one is correct. Several names can still share an operator, upstream clock, or network failure.
Authentication proves the identity of a source. It does not prove that the source reports the correct time.
Every source is authenticated #
By default, timed requires Network Time Security (NTS). A Transport Layer Security (TLS) exchange on port 4460 establishes keys for authenticated Network Time Protocol (NTP) messages.
timed checks the certificate against the configured server name, using roots supplied by trustd for server authentication. A DNS alias can change the address used for the connection; it cannot choose a different trusted certificate identity.
Roots are loaded at startup and refreshed after handshake failures. timed does not subscribe to trust-store changes. A distrust change therefore does not immediately invalidate an established NTS session or its cached cookies.
A blocked key-exchange port prevents new handshakes. Cached cookies can keep an existing source usable without another handshake. If no usable source remains, timed reports that the clock is unsynchronized. Allowing plain NTP is an explicit policy choice described in Configuring Time Sources.
The default sources #
When neither configured sources nor eligible network-provided sources supply a list, timed uses these operator hostnames:
time.cloudflare.comnts.netnod.septbtime1.ptb.de
These names identify three operators. They do not guarantee independent upstream clocks, reachability, or correct time. Replacing a fallback operator requires a configuration or software update; changing a Peios DNS alias does not change the authenticated identity.
Two circles, and how they are broken #
A machine with an incorrect hardware clock can reject valid certificates as not yet valid. timed raises a clock below its recorded build epoch to that lower bound. The epoch is stored in the source tree so that rebuilding the same source does not change the bound.
The floor is a bootstrap aid, not verified time. Certificates still have to be valid at the resulting clock reading. A machine can remain unable to complete a handshake after the floor is applied.
NTS cookies from successful exchanges are saved under /var/state/timed.
They can let a restarted service obtain authenticated time before another
TLS exchange. The startup hook protects this state for SYSTEM,
Administrators, and timed's service identity. Cookie files contain secrets.
Steering, not jumping #
Ordinary correction changes the clock's rate gradually, called slewing. A clock step changes the wall-clock reading immediately and can affect file timestamps, log ordering, and software that uses wall-clock deadlines.
The automatic discipline permits an initial correction of any size when usable sources agree. After synchronization, a persistent large offset can cause a step after 15 minutes. An offset above 1000 seconds is refused rather than automatically accepted after synchronization.
Manual changes and the boot floor also step the clock. Turning automatic time back on restarts source acquisition and permits another initial correction. A reload is not a guarantee of uninterrupted wall-clock time.
Each step emits timed.clock.stepped. Its operation.name distinguishes
automatic, manual, and boot-floor. See the
installed evman timed.clock.stepped definition and the
timed.clock.stepped evman entry for the recorded fields. Slewing does not
emit a step event.
Learning the crystal #
timed estimates the machine clock's frequency error and saves it in
/var/state/timed/drift. Reusing that estimate can shorten settling after a
restart. Accuracy without network measurements depends on the clock's
stability and the quality of the saved estimate.
What timed does not do #
timed is a client, not a network time server. It does not serve time to other machines or directly write the hardware clock. The kernel periodically updates the hardware clock when the system clock is marked synchronized.
The machine clock represents UTC. timed applies the selected local-zone data
to /etc/localtime; individual programs can choose a different display zone.
See Changing the Time Zone and
Clock
for the distinction and the operational checks.
Configuring Time Sources
Peios / Using Peios / Time
Configure time sources when the machine needs a particular operator or a network's time service. Check the effective sources after applying policy: a saved setting does not establish synchronization.
Before you start #
- Install and start timed and its
clockcommand. - Obtain write access to
Machine\System\Timeto change policy. - Obtain timed's control right to request a reload. Registry write access and the control right are separate permissions.
- Choose sources with independent failure modes. Prefer authenticated sources and check that their certificates cover the configured names.
The regman entry for Machine\System\Time owns the complete configuration
reference. clock(1) describes the command interface.
Naming your own servers #
-
Inspect the existing state and policy:
-
Set the source list. This example selects the shipped public operators explicitly, so network-provided time servers cannot replace the list:
-
Reload and check the result using the procedure below.
An entry names a host, optionally a port, followed by supported option words.
prefer breaks ties between agreeing sources. It does not make a disagreeing
source valid. A malformed entry is logged and omitted.
Precedence is first match, not merge #
timed selects the first nonempty list in this order:
- Successfully parsed
Serversentries. - Network-provided time servers, when
UseFromDHCPpermits them. - The shipped fallback set.
The selected list replaces later choices. A domain policy can write
Servers; the selector has no separate domain-discovery stage.
Authentication filtering happens after selection. An explicit list containing
only plain-NTP sources produces no usable sources when
AllowUnauthenticated is 0; it does not fall through to public servers.
If every explicit entry is malformed, selection continues to the next list.
To remove an explicit override:
This restores the selection order. It does not necessarily select the public fallbacks because network-provided sources can take precedence.
Turning authentication off #
Plain Network Time Protocol (NTP) does not authenticate replies. Someone who can observe and alter the exchange can supply false time. Certificate validation and authentication systems can be affected by an incorrect clock.
For an explicitly configured plain-NTP source, both settings are required:
- The entry includes
unauthenticatedornoauth. AllowUnauthenticatedis1.
Use this policy only after accepting the trust placed in the server and its
network path. Changing AllowUnauthenticated back to 0 excludes all plain
sources, including those explicitly marked unauthenticated.
DHCP time servers #
Dynamic Host Configuration Protocol (DHCP) time servers are eligible when
UseFromDHCP is 1 and no valid explicit list takes precedence. They are
plain-NTP sources, so AllowUnauthenticated must also be 1.
Before allowing them, account for every network the machine can join. A network controls the time-server addresses it offers. This machine-wide setting follows the machine between networks.
netd publishes DHCP option 42 independently of whether its offered DNS configuration is accepted. See The Resolver Channel. timed applies its own time-source policy to that information.
Poll intervals #
MinPoll and MaxPoll are powers of two seconds. Their defaults are 6 and
10, giving intervals from 64 seconds through about 17 minutes. Values are
clamped to the range documented in regman.
Shorter intervals increase server traffic. Longer intervals help estimate frequency error. Keep the defaults unless measurements justify a change.
Doing it from a domain #
Distribute time policy through registry policy using the same values. The policy must still produce sources that pass authentication and selection. A successful registry update does not establish correct time on each machine.
Reload and verify #
-
Request a reload:
-
Inspect the source list and clock state:
-
Check the source names, authentication, failure notes, selected source, accuracy estimate, and age of the last update. Repeat after further polls if the clock is still settling.
A failed configuration read retains the last complete configuration and returns a reload error. A registry notification triggers another read. Malformed individual server entries remain warnings and are omitted. A successful reload means the configuration was read, not that sources have answered or agreed.
When something is wrong #
A source marked falseticker disagrees with the selected set. Investigate
that source and the agreement among the others; the label alone does not
prove which clock is correct. An unreachable source includes a failure note
when timed has one.
If no source is selected, compare Servers, UseFromDHCP, and
AllowUnauthenticated with the reported list. Check whether Automatic is
0. A wrong local-zone display needs a zone correction, not necessarily a
change of time source.
If reload is refused, check the separate
control permission.
A refused reload does not undo a registry write. If clock cannot contact
timed, it has not established whether sources are usable.
Changing an active source list #
Reordering sources preserves each unchanged source's session and pending work. Removing a source discards results that arrive for that old source. Changing its port or authentication mode starts a new association. A source removed and later added again does not inherit an earlier pending result.
Changing the Time Zone and Clock
Peios / Using Peios / Time
Change the time zone when the clock is correct but local time is displayed incorrectly. Set the clock manually when no suitable time source is available. The machine clock represents UTC; the zone controls its local display.
Before you start #
- Install timed,
clock, and the time-zone database. - Obtain registry write access to
Machine\System\Timeto change settings. - Obtain timed's control right to reload or set the clock.
- Before a manual change, account for its effect on timestamps and software that uses wall-clock deadlines.
clock(1) owns the command syntax. The regman entry for
Machine\System\Time describes the settings and access checks.
Using the graphical settings {#in-system-settings} #
Open System Settings and select Time & Date to inspect the machine's zone, automatic-time policy, and sources. Changing machine time is separate from choosing a 12- or 24-hour desktop display; see Desktop Settings.
Verify the effective zone and clock state after a change. A saved setting does not prove that the zone data was applied or that sources agree.
In a terminal #
Change the time zone #
-
Check the reported zone:
-
Select an installed zone, for example:
-
Read
clock statusagain and check timed's log for zone errors.
The name identifies data under /usr/share/zoneinfo. An invalid or missing
zone is refused before copying, leaving the previous file in place. timed
retries a refused name after configuration changes and every 10 minutes.
Deleting TimeZone requests UTC.
On restart, timed identifies the zone only when its saved name and installed
zone data match /etc/localtime. If identification fails, clock reports
UTC (none chosen), even if the existing file contains another zone.
A copy failure after /etc/localtime is truncated can leave incomplete data.
The retained status name is not a fresh verification of the file. Resolve
copy or saved-name errors before interpreting or setting local time.
Set the clock manually #
-
Confirm the zone and resolve any errors described above.
-
Turn off automatic time and reload:
-
Run
clock setwith the intended local date and time. For example, the syntax for 14:05 on October 19, 2026 is: -
Check
clock status. It should report manual operation and the intended zone. Manual time is not network synchronization.
Use @SECONDS instead of a local date to specify a UTC Unix timestamp.
timed refuses manual setting while Automatic is 1.
Return to automatic time #
-
Account for a possible clock step when sources agree. Reacquisition permits an initial correction of any size.
-
Restore automatic operation:
-
Check
clock sourcesandclock statusas measurements arrive. Confirm authentication, agreement, accuracy, and fresh updates.
Coordinating changes with timed {#why-not-just-set-the-clock} #
Changing the clock outside timed leaves the service measuring an unexpected
error. It can correct the change or refuse a sufficiently large offset.
Using clock set coordinates the change with the service and emits
timed.clock.stepped with operation manual and the requesting identity.
Read the installed definition with evman timed.clock.stepped.
Individual programs can display UTC with date -u or use a TZ environment
setting where supported. Those choices do not change the machine clock.
File validation #
Zone files and metadata must be regular files of at most 16 MiB. Aliases to regular files are supported. Timed checks the opened zone file and copies that same data, so validation and copying cannot select different files.
Timed updates the pre-created /etc/localtime file in place. Readers can
observe an empty or partial copy, and a write failure can leave a partial
copy. Its directory permissions do not allow an atomic rename by the service.
Understanding Clock Status
Peios / Using Peios / Time
clock reports what timed knows about the machine's time. Its status and
source views help distinguish a display-zone problem from a failure to obtain
usable time. clock(1) owns the command syntax and exit-status reference.
Status #
Read clock status starting with state, following, accuracy, and
the age of the last update. The state labels retain their wire spelling:
| State | Meaning |
|---|---|
synchronised | The clock is being kept from usable measurements. |
settling | The frequency estimate is still converging. |
spike | A large offset is being checked before changing the clock. |
unsynchronised | The clock has no accepted synchronization. |
Manual operation adds Automatic is 0: the clock is set by hand. That is
not evidence of network synchronization.
Accuracy combines uncertainty reported by the selected measurements. It helps assess clock quality, but does not independently prove the time. Frequency estimates the hardware clock's error in parts per million. The saved drift estimate lets later starts reuse what timed has learned.
Stepped records cumulative steps since startup. Unexpected changes call
for inspection of timed.clock.stepped events. Manual changes, automatic
corrections, and the boot floor have distinct operation names.
Floor is the recorded build epoch, used as a lower bound. Remaining near the floor does not establish correct time or certificate validity.
Time zone is timed's recorded zone for /etc/localtime. An unidentified
file is displayed as UTC (none chosen). A failed copy can also leave the
reported name without valid corresponding data. Resolve errors using the
zone procedure.
Sources #
clock sources shows each source's state, authentication, reach history,
measurements, and age. The leading markers summarize selection:
| Mark | State | Meaning |
|---|---|---|
* | system-peer | Selected source for the system's reference figures. |
+ | candidate | Agrees and contributes to the combined measurement. |
- | outlier | Agrees but is excluded because of measurement quality. |
x | falseticker | Disagrees with the selected set. |
? | unusable | Has answered but cannot supply usable time. |
| blank | unreachable | Has no usable reply history. |
Auth distinguishes authenticated NTS from plain time. Reach is an
octal mask of the last eight polls, newest in the lowest bit. 377 means
all eight answered; 376 means the latest poll failed; 0 means none
answered. Stale measurements stop contributing when reach is lost.
Last is the age of the last answer. Read any note below a source before changing policy: a connection failure and a certificate failure need different investigation.
Setting the clock #
clock set requests a coordinated manual step. It requires manual mode and
timed's control right. The
manual-time
procedure
covers prerequisites, local-zone interpretation, and checks afterward.
Exit statuses #
An unsuccessful query does not establish the state of the clock. In
particular, a failed connection differs from a successful source query
finding no sources. Scripts should use the exit statuses documented in
clock(1) instead of inferring success from partial output.
When reload is refused #
Reloading and setting time require timed's control right. Querying status
and sources is public under the default policy. The control descriptor is
Machine\System\Time ControlSecurity; SYSTEM and Administrators receive
control access by default.
Registry write access is a separate check. A successful policy write does not prove that the caller can reload, and a refused reload does not undo the write. A configuration-read failure also makes reload fail while timed retains its last complete configuration.