The timedatectl command in Linux: managing system date and time

Introduction

The timedatectl command is an essential tool in modern Linux distributions that allows you to query and modify the system’s date, time, and time zone configuration, as well as manage synchronization via the NTP protocol. With the advent of systemd, timedatectl became the unified interface for these tasks, replacing old tools such as date, hwclock, and ntpdate. In this article you will learn from the basics to advanced examples that will help you keep your server or workstation always on the correct time.

What is timedatectl?

timedatectl is part of the systemd package and runs in user space. It does not require root privileges to display information, but it does to change the configuration. Its output includes the local time, universal time (UTC), the NTP synchronization status, and the configured time zone.

Basic syntax

The general format is: timedatectl [OPTIONS] [COMMAND]. Some of the most used options are --no-pask to suppress paging and --adjust-system-clock when changing the time zone. The main commands are set-time, set-timezone, set-ntp and status.

Show current configuration

Running timedatectl without arguments displays a full summary. The output includes lines such as:

  • Local time: Fri 2025-09-24 10:30:00 CEST
  • Universal time: Fri 2025-09-24 08:30:00 UTC
  • RTC time: n/a
  • Time zone: Europe/Madrid (CEST, +0200)
  • System clock synchronized: yes
  • NTP service: active
  • RTC in local TZ: no

Change the date and time

To manually set the date and time, use timedatectl set-time 'YYYY-MM-DD HH:MM:SS'. For example:

timedatectl set-time '2025-10-01 15:30:00'

This command temporarily stops NTP synchronization, applies the new value, and, if desired, NTP can be re‑activated afterwards.

Set the time zone

The list of available zones is obtained with timedatectl list-timezones. To set a zone, for example America/New_York, run:

timedatectl set-timezone America/New_York

The system immediately updates the clock and saves the configuration to /etc/localtime.

Enable or disable NTP synchronization

The NTP service is controlled with set-ntp. To enable it:

timedatectl set-ntp true

To disable it:

timedatectl set-ntp false

When active, systemd-timesyncd (or the configured NTP daemon) keeps the clock synchronized with time servers.

Practical examples

  • Check the status before changing: timedatectl status
  • Change to Tokyo time zone and synchronize: timedatectl set-timezone Asia/Tokyo && timedatectl set-ntp true
  • Reset the clock to the hardware value (RTC): timedatectl set-local-rtc 0 (to use UTC in the hardware clock)
  • Temporarily disable NTP for testing: timedatectl set-ntp false, make changes, then re‑enable it.

Common troubleshooting

If the command returns Failed to set time: Unit dbus-org.freedesktop.timedate1.service not found, make sure systemd is running and that you have sudo privileges. Another frequent symptom is desynchronization after changing the time zone; in that case, restart the time service with systemctl restart systemd-timesyncd.

Conclusion

timedatectl is a powerful and simple interface for handling all aspects of the system clock in Linux. Mastering its use lets you avoid logging problems, ensure log consistency, and guarantee that time‑dependent applications work correctly. With the examples and explanations presented, you are now ready to configure date, time, and time zone on any systemd‑based distribution.

This post is also available in ESPAÑOL.

Leave a Reply

Your email address will not be published. Required fields are marked *

Esta obra está bajo una Licencia Creative Commons Atribución 4.0 Internacional para Francesc Roig francesc@vivaldi.net .