🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

timedatectl Command

Beginner Systemd & Services man(1)

Control system time and date settings

👁 8 views 📅 Updated: Mar 15, 2026
SYNTAX
timedatectl [COMMAND]

What Does timedatectl Do?

timedatectl controls system time and date settings. It manages the system clock, timezone, NTP synchronization, and RTC (hardware clock) settings.

timedatectl is the systemd way to manage time. It replaces manual date commands and ntpdate for time management. It can enable/disable automatic time synchronization via NTP.

Correct time is critical for certificates, logs, authentication (Kerberos), and distributed systems. timedatectl ensures the system clock is accurate and properly configured.

Options & Flags

OptionDescriptionExample
status Show current time settings timedatectl status
set-timezone Set the timezone sudo timedatectl set-timezone Europe/London
list-timezones List available timezones timedatectl list-timezones
set-ntp Enable/disable NTP sync sudo timedatectl set-ntp true
set-time Set time manually sudo timedatectl set-time "2024-01-15 14:30:00"

Practical Examples

#1 Show time status

Shows current time, timezone, and NTP status.
$ timedatectl
Output: Local time: Mon 2024-01-15 14:30:00 UTC Time zone: UTC (UTC, +0000) NTP synchronized: yes

#2 Set timezone

Changes the system timezone.
$ sudo timedatectl set-timezone Europe/Budapest

#3 List timezones

Shows available European timezones.
$ timedatectl list-timezones | grep Europe
Output: Europe/Amsterdam\nEurope/Berlin\nEurope/Budapest\nEurope/London

#4 Enable NTP

Enables automatic time synchronization.
$ sudo timedatectl set-ntp true

#5 Set time manually

Disables NTP and sets time manually (disable NTP first).
$ sudo timedatectl set-ntp false && sudo timedatectl set-time "2024-01-15 14:30:00"

Tips & Best Practices

Always use NTP: Enable NTP sync: timedatectl set-ntp true. Manual time setting drifts. NTP keeps the clock accurate.
Timezone vs UTC: Servers typically use UTC. timedatectl set-timezone UTC. Workstations use local time.
Disable NTP before manual time: You must disable NTP (set-ntp false) before setting time manually. NTP will override manual changes.

Frequently Asked Questions

How do I change the timezone?
sudo timedatectl set-timezone ZONE. List available zones: timedatectl list-timezones.
How do I enable NTP?
sudo timedatectl set-ntp true enables automatic time synchronization.
How do I check if NTP is working?
timedatectl shows "NTP synchronized: yes" when time is synced.

Master Linux with Professional eBooks

Curated IT eBooks covering Linux, DevOps, Cloud, and more

Browse Books →