Quick take: timedatectl status shows the current time, timezone, and NTP sync state. timedatectl set-timezone Region/City changes the timezone. timedatectl set-ntp true enables automatic time sync.
Introduction
timedatectl is the systemd command for managing date, time, timezone, and NTP synchronization on Linux systems. It replaces the older date command for configuration tasks and provides a clean interface to systemd-timesyncd — the built-in NTP client.
Correct system time is critical for SSL certificates, log correlation, Kerberos authentication, cron jobs, and distributed systems. timedatectl is the first command to run when setting up a new server or diagnosing time-related failures.
View Time Status
timedatectl statusSample output:
Local time: Tue 2026-04-15 14:23:45 AST
Universal time: Tue 2026-04-15 11:23:45 UTC
RTC time: Tue 2026-04-15 11:23:44
Time zone: Asia/Riyadh (AST, +0300)
System clock synchronized: yes
NTP service: active
RTC in local TZ: noKey fields: System clock synchronized (is NTP working?), NTP service (active/inactive), Time zone (current zone and offset).
Set Timezone
# List all available timezones
timedatectl list-timezones
# Filter by region
timedatectl list-timezones | grep Asia
timedatectl list-timezones | grep Europe
# Set timezone
timedatectl set-timezone Asia/Riyadh
timedatectl set-timezone Europe/London
timedatectl set-timezone America/New_York
timedatectl set-timezone UTC
# Verify the change
timedatectl statusThe change takes effect immediately — running processes pick up the new timezone for log timestamps on the next restart, but the system clock itself is updated instantly.
Enable NTP Sync
# Enable NTP synchronization
timedatectl set-ntp true
# Disable NTP (required before setting time manually)
timedatectl set-ntp false
# Check NTP status
timedatectl show --property=NTPSynchronized
timedatectl show --property=NTPServiceWhen NTP is enabled, systemd-timesyncd contacts time servers and adjusts the clock continuously. On a fresh server, initial sync may take 30–60 seconds.
Set Time Manually
# Must disable NTP first — NTP will override manual settings
timedatectl set-ntp false
# Set date and time
timedatectl set-time '2026-04-15 14:30:00'
# Set only the date
timedatectl set-time '2026-04-15'
# Re-enable NTP after manual adjustment
timedatectl set-ntp truesystemd-timesyncd Configuration
systemd-timesyncd is the NTP client that timedatectl controls. Its configuration lives at /etc/systemd/timesyncd.conf.
# View current NTP servers
cat /etc/systemd/timesyncd.conf
# Edit to set custom NTP servers
sudo nano /etc/systemd/timesyncd.confDefault content:
[Time]
NTP=0.ubuntu.pool.ntp.org 1.ubuntu.pool.ntp.org
FallbackNTP=ntp.ubuntu.com
#RootDistanceMaxSec=5
#PollIntervalMinSec=32
#PollIntervalMaxSec=2048After editing, restart the service:
sudo systemctl restart systemd-timesyncd
timedatectl statusTroubleshooting Time Issues
# Check timesyncd service status and recent logs
systemctl status systemd-timesyncd
# Watch sync journal
journalctl -u systemd-timesyncd -f
# If NTP is not syncing — check firewall (UDP 123 must be open)
sudo ufw status
# or
sudo firewall-cmd --list-all
# Force resync by restarting the service
sudo systemctl restart systemd-timesyncd
# Check hardware clock vs system clock
hwclock --show
timedatectl | grep "RTC time"Final Thoughts
timedatectl is the authoritative tool for time management on systemd-based Linux systems. Run it immediately on any new server to verify the timezone and NTP are correctly configured. Incorrect time causes SSL errors, authentication failures, and corrupted log correlation — problems that are often misdiagnosed as application bugs.
FAQ: timedatectl Command in Linux
How do I set the timezone on a Linux server?+
Run timedatectl set-timezone Asia/Riyadh (replace with your timezone). Use timedatectl list-timezones | grep Region to find your timezone string. The change takes effect immediately.
How do I enable NTP time synchronization?+
Run timedatectl set-ntp true. This enables systemd-timesyncd, which syncs the clock automatically. Check sync status with timedatectl status and look for 'NTP service: active'.
How do I check if NTP is working on my server?+
Run timedatectl status and check the 'System clock synchronized' field. If it shows 'no', run systemctl status systemd-timesyncd to see why the sync is failing.
What is the difference between system clock and hardware clock?+
The system clock runs in kernel memory and is read by applications. The hardware clock (RTC) runs on the motherboard and persists through reboots. timedatectl syncs both.
How do I manually set the system time with timedatectl?+
First disable NTP: timedatectl set-ntp false. Then set the time: timedatectl set-time '2026-04-15 14:30:00'. Re-enable NTP afterward with timedatectl set-ntp true.
Need help with Linux servers or infrastructure?
Work directly with Muhammad Irfan Aslam for Linux, Ubuntu, Docker, DevOps, cloud, CI/CD, or infrastructure support.
Hire Me for Support