timedatectl Command in Linux: Syntax, Options & Practical Examples (systemd)

timedatectl reads and sets the system clock, time zone, NTP synchronization, and RTC mode on systemd-based Linux. It talks to systemd-timedated and systemd-timesyncd for status and one-line changes without hand-editing zoneinfo files.

Published

Updated

Read time 10 min read

Reviewed byDeepak Prasad

timedatectl Command in Linux: Syntax, Options & Practical Examples (systemd)
About timedatectl reads and sets the system clock, time zone, NTP synchronization, and RTC mode on systemd-based Linux. It talks to systemd-timedated and systemd-timesyncd for status and one-line changes without hand-editing zoneinfo files.
Tested on Ubuntu 25.04 (Plucky Puffin); systemd 257.4-1ubuntu3.2; kernel 7.0.0-27-generic
Package systemd
Man page timedatectl(1)
Privilege none for status; root / sudo to change settings
Distros

systemd-based distros (Ubuntu 16.04+, Debian 8+, Fedora, RHEL 7+, Arch, …).

Legacy workflows: tzselect, /etc/timezone, or ln -sf under /etc/localtime.

Related guide

timedatectl — quick reference

Status and properties

Read local time, UTC, RTC, time zone, and whether NTP sync is active.

When to use Command
Human-readable summary of time settings timedatectl status
Print all timedated properties timedatectl show
Show only one property (machine-readable) timedatectl show -p Timezone --value
Show named properties and values only timedatectl -p Timezone -p NTP show
Include empty properties timedatectl show -a

Time zone

List IANA zones and set the system time zone in one command.

When to use Command
List every available time zone timedatectl list-timezones
Narrow the list (example: London) timedatectl list-timezones | grep London
Set the system time zone sudo timedatectl set-timezone Europe/London

Network time (NTP)

Enable or disable synchronization through systemd-timesyncd (or the distro NTP client wired to timedated).

When to use Command
Turn NTP synchronization on sudo timedatectl set-ntp true
Turn NTP synchronization off sudo timedatectl set-ntp false
Check whether NTP is enabled timedatectl show -p NTP --value

Hardware clock (RTC)

Control whether the hardware clock stores UTC or local time — UTC is recommended on Linux.

When to use Command
Read RTC mode timedatectl show -p LocalRTC --value
Store UTC on the hardware clock (recommended) sudo timedatectl set-local-rtc false
Store local time on the hardware clock (dual-boot with Windows) sudo timedatectl set-local-rtc true
Adjust system clock when flipping RTC mode sudo timedatectl set-local-rtc false --adjust-system-clock

systemd-timesyncd

Extra commands when systemd-timesyncd provides NTP on your distro.

When to use Command
Show sync server and poll interval timedatectl timesync-status
Show timesyncd unit properties timedatectl show-timesync
Monitor timesyncd events timedatectl --monitor

Help and version

When to use Command
Show built-in usage timedatectl --help
Show systemd package version timedatectl --version

timedatectl — command syntax

Synopsis from timedatectl --help on Ubuntu 25.04 (systemd 257):

text
timedatectl [OPTIONS...] COMMAND ...

Commands:
  status                   Show current time settings
  show                     Show properties of systemd-timedated
  set-time TIME            Set system time
  set-timezone ZONE        Set system time zone
  list-timezones           Show known time zones
  set-local-rtc BOOL       Control whether RTC is in local time
  set-ntp BOOL             Enable or disable network time synchronization

systemd-timesyncd Commands:
  timesync-status          Show status of systemd-timesyncd
  show-timesync            Show properties of systemd-timesyncd
  ntp-servers INTERFACE SERVER…
                           Set the interface specific NTP servers
  revert INTERFACE         Revert the interface specific NTP servers

Options:
  -h --help                Show this help message
     --version             Show package version
     --no-pager            Do not pipe output into a pager
     --no-ask-password     Do not prompt for password
  -H --host=[USER@]HOST    Operate on remote host
  -M --machine=CONTAINER   Operate on local container
     --adjust-system-clock Adjust system clock when changing local RTC mode
     --monitor             Monitor status of systemd-timesyncd
  -p --property=NAME       Show only properties by this name
  -a --all                 Show all properties, including empty ones
     --value               When showing properties, only print the value
  -P NAME                  Equivalent to --value --property=NAME

set-timezone updates /etc/localtime (symlink) and often /etc/timezone on Debian-family systems. Changes need sudo.


timedatectl — command examples

Essential Read local time, UTC, zone, and NTP state

Before changing time settings, check what the host thinks the clock is doing — zone, whether NTP is on, and if the journal considers the clock synchronized.

Run the command:

bash
timedatectl status

Sample output:

text
Local time: Wed 2026-07-01 19:06:22 IST
           Universal time: Wed 2026-07-01 13:36:22 UTC
                 RTC time: Wed 2026-07-01 13:07:18
                Time zone: Asia/Kolkata (IST, +0530)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no

NTP service: active means synchronization is enabled — System clock synchronized: no can appear briefly until the first successful poll. Fix clock drift before package managers complain about "Release file not valid yet" errors.

Essential Change time zone safely and restore the original

Lab docs and screenshots often need a different zone for a minute. Save the current zone, set a new one, verify, then put the original back.

bash
ORIG_TZ=$(timedatectl show -p Timezone --value)
echo "Original zone: $ORIG_TZ"
sudo timedatectl set-timezone UTC
timedatectl show -p Timezone --value
timedatectl status | grep 'Time zone'
sudo timedatectl set-timezone "$ORIG_TZ"
timedatectl show -p Timezone --value

Sample output (middle section):

text
Original zone: Asia/Kolkata
UTC
                Time zone: UTC (UTC, +0000)
Asia/Kolkata

Always restore $ORIG_TZ on shared hosts. Applications pick up the new zone immediately — no reboot required.

Essential Find a zone name before set-timezone

set-timezone expects an IANA name such as Europe/London, not a three-letter abbreviation like IST. Search the built-in list instead of guessing.

List all zones (long output) or filter:

bash
timedatectl list-timezones | grep -E '^Europe/London$|^UTC$'
timedatectl list-timezones | grep Kolkata

Sample output:

text
Europe/London
UTC
Asia/Kolkata

Copy the full Region/City string into sudo timedatectl set-timezone Zone. See also the Ubuntu set timezone guide for GUI and file-based alternatives.

Common Query timedated properties for scripts

show exposes the same facts as status but as Key=value lines — easier for scripts than parsing the banner.

Print everything:

bash
timedatectl show

Sample output:

text
Timezone=Asia/Kolkata
LocalRTC=no
CanNTP=yes
NTP=yes
NTPSynchronized=no
TimeUSec=Wed 2026-07-01 19:06:22 IST
RTCTimeUSec=Wed 2026-07-01 18:37:18 IST

One property, value only:

bash
timedatectl show -p Timezone --value
timedatectl -p Timezone -p NTP --value show

Sample output:

text
Asia/Kolkata
yes

Use -p repeatedly or --value when you only need a single field in a pipeline.

Common Enable or disable network time sync

Turn NTP off for a controlled manual clock change, then turn it back on so the host stays accurate.

Check current state, disable, re-enable:

bash
timedatectl show -p NTP --value
sudo timedatectl set-ntp false
timedatectl show -p NTP --value
sudo timedatectl set-ntp true
timedatectl show -p NTP --value

Sample output:

text
yes
no
yes

On Ubuntu, set-ntp true usually activates systemd-timesyncd. Some servers use chrony instead — NTP may still show yes while timesyncd is inactive; check your distro's default NTP daemon if sync never succeeds.

Common See which NTP server timesyncd uses

When the clock will not settle, timesync-status shows the peer, poll interval, and packet count for systemd-timesyncd.

Run the command:

bash
timedatectl timesync-status

Sample output:

text
Server: 185.125.190.58 (ntp.ubuntu.com)
Poll interval: 34min 8s (min: 32s; max 34min 8s)
 Packet count: 0

Low packet count right after boot is normal. If the server line is missing, timesyncd may not be running — inspect with systemctl status systemd-timesyncd.

Advanced Machine-readable timesyncd properties

show-timesync dumps unit properties — fallback servers, poll limits, and frequency correction — for deeper debugging than timesync-status.

Run the command:

bash
timedatectl show-timesync | head -8

Sample output:

text
FallbackNTPServers=ntp.ubuntu.com
ServerName=ntp.ubuntu.com
ServerAddress=185.125.190.57
RootDistanceMaxUSec=5s
PollIntervalMinUSec=32s
PollIntervalMaxUSec=34min 8s
PollIntervalUSec=32s
Frequency=0

Pair this with timedatectl --monitor when you need a live stream of sync events during firewall or DNS changes.

Advanced RTC in UTC vs local time (read before changing)

RTC in local TZ: no means the hardware clock stores UTC — the recommended Linux default. Set set-local-rtc true only for dual-boot with Windows, which historically expected local time on the CMOS clock.

Read the current mode:

bash
timedatectl status | grep 'RTC in local'
timedatectl show -p LocalRTC --value

Sample output:

text
RTC in local TZ: no
no

Flipping RTC mode affects firmware clock interpretation. If you must change it, use --adjust-system-clock so the running system time stays consistent:

bash
sudo timedatectl set-local-rtc false --adjust-system-clock

Revert only when you deliberately changed the mode for dual-boot testing — on pure Linux servers, leave LocalRTC=no.


timedatectl — when to use / when not

Use timedatectl for everyday clock and zone work on systemd. Reach for other tools when a different time stack owns the host.

Use timedatectl when Use something else when
  • You need to read or set the system time zone on Ubuntu, Fedora, or RHEL with systemd
  • You want to turn NTP sync on or off without editing unit files by hand
  • You are checking whether the clock is synchronized before apt, TLS, or logging troubleshooting
  • You need script-friendly show -p … --value output
  • You want timesyncd peer details on distros that ship systemd-timesyncd
  • chrony or ntpd is the mandated NTP daemon → chronyc tracking or ntpq -p
  • Minimal container without timedated → set TZ env var or mount /etc/localtime
  • You only need a one-off manual clock set in an old script → date -s (then fix NTP policy)
  • Windows dual-boot RTC policy → plan CMOS impact; may still use set-local-rtc with care
  • Deeper timezone walkthrough with GUI steps → Set timezone on Ubuntu

timedatectl vs date

timedatectl date
Scope Zone, NTP policy, RTC mode, timesyncd Display or set current time once
Persists zone Yes (set-timezone) No — only shows shifted time with TZ=
NTP control set-ntp true/false None
Best for systemd admin and automation Quick timestamp in scripts

Use timedatectl set-time only when NTP is off and you accept a manual clock — prefer NTP on production hosts.


Clock, logs, and host identity often get checked in the same troubleshooting pass.

Command One line
timedatectl Time zone and NTP on systemd (this page)
hostnamectl Hostname and OS summary on systemd
journalctl Logs — timestamps follow the system clock
systemctl Enable or debug systemd-timesyncd

Browse the full index on the Linux commands cheat sheet.


timedatectl — interview corner

What is timedatectl used for?

timedatectl is the command-line client for systemd-timedated. It shows and changes:

  • System time zone
  • NTP synchronization on/off
  • Whether the RTC stores UTC or local time
  • systemd-timesyncd status on distros that use it
bash
timedatectl status

A strong answer is:

"timedatectl is systemd's tool to view and set time zone, NTP sync, and RTC mode. I use timedatectl status first, then set-timezone or set-ntp as needed."

What is the difference between NTP service active and System clock synchronized?

NTP service: active means the OS is configured to sync over the network (policy enabled). System clock synchronized: yes means a sync source has recently corrected the clock.

They can diverge right after boot or when the network blocks NTP:

bash
timedatectl status | grep -E 'synchronized|NTP service'

A strong answer is:

"Active NTP is the policy — synchronization yes/no is live state. I check timesync-status or chrony if active stays yes but synchronized stays no."

What does timedatectl set-timezone change on disk?

set-timezone sets the libc view of local time — typically by pointing /etc/localtime at the right zoneinfo file and updating /etc/timezone on Debian/Ubuntu.

bash
timedatectl set-timezone Europe/London
readlink -f /etc/localtime

No reboot is required; long-running apps may need a restart if they cache the old offset.

A strong answer is:

"set-timezone updates /etc/localtime and often /etc/timezone — applications see the new offset immediately, but some daemons need a restart."

Should the hardware clock use UTC or local time on Linux?

Linux expects UTC on the RTC (RTC in local TZ: no). That avoids daylight-saving jumps in the firmware clock.

bash
timedatectl show -p LocalRTC --value

Use local RTC mainly for Windows dual-boot, where the other OS historically wrote local time to CMOS.

A strong answer is:

"UTC on the RTC for Linux-only servers — LocalRTC=no. I only set local RTC for dual-boot with Windows, and I use --adjust-system-clock when flipping the mode."

How does timedatectl relate to chrony or ntpd?

timedatectl set-ntp toggles whether systemd-timedated enables network time — on Ubuntu desktop that is often systemd-timesyncd. Enterprise servers may run chrony or ntpd instead; timedatectl still reports NTP policy, but peer details come from the active daemon.

bash
timedatectl timesync-status
systemctl is-active systemd-timesyncd chronyd 2>/dev/null

A strong answer is:

"timedatectl controls NTP policy at the timedated layer; timesync-status is for systemd-timesyncd. On chrony hosts I still use timedatectl for timezone, but I debug sync with chronyc."


Troubleshooting

Symptom Likely cause Fix
Invalid or not listed time zone Typo or deprecated zone name timedatectl list-timezones | grep City
System clock synchronized: no for a long time Firewall, DNS, or NTP blocked Open UDP 123; check timedatectl timesync-status
NTP service: inactive NTP disabled sudo timedatectl set-ntp true
apt "Release file not valid yet" Clock behind real time Enable NTP, wait for sync, or fix manual clock
set-time refused NTP still enabled sudo timedatectl set-ntp false, set time, re-enable NTP
timesync-status empty chrony owns NTP, not timesyncd Use chronyc tracking on chrony hosts

References

Rohan Timalsina

is a technical writer and Linux enthusiast who writes practical guides on Linux commands and system administration. He focuses on simplifying complex topics through clear explanations.