System and processes

The timedatectl command

Shows and changes the system time, time zone and NTP synchronisation.

Syntax

timedatectl [opciones] [comando]Try it in the terminal →

Most useful options

statusLocal time, UTC, RTC, zone and whether the clock is synchronised. It is the default command
showThe same as status, in a format programs can read
list-timezonesLists the available zones, one per line
set-timezone ZONAChanges the time zone. It alters the /etc/localtime link
set-time FECHASets the system time, for example '2026-11-06 18:17:16'
set-ntp BOOLtrue enables network time synchronisation; false disables it

Copy-ready examples

$ timedatectltime, zone and synchronisation status.
$ timedatectl list-timezones | grep Madridfinds the exact name of your zone before changing it.
$ sudo timedatectl set-timezone Europe/Madridchanges the time zone. It usually asks for administrator rights.
$ sudo timedatectl set-ntp trueenables network synchronisation with the first service available.
$ timedatectl showthe same status in key=value format, for use in scripts.

You can try them in the browser terminal: it does not touch your computer.

Common errors

MessageCauseFix
Failed to set time: Automatic time synchronization is enabledset-time will not change the clock while network synchronization is on.Turn it off with sudo timedatectl set-ntp false, set the time, then turn it back on.
Failed to set time zone: Invalid or not installed time zone 'Europe/Madrd'The zone name does not exist on the system: a letter is missing or it is not installed.List the zones with timedatectl list-timezones and copy the exact name.
Failed to connect to system scope bus via local transport: No such file or directoryThere is no systemd bus to connect to: the system does not use systemd or the service is not running, as in some containers.Run the command on a system with systemd running. Inside a container, the clock is the one of the host.

Typical mistakes

  • If the clock is wrong, check that 'System clock synchronized' is yes and that 'NTP service' is active.
  • list-timezones shows names like Europe/Madrid: use that exact text, not the name of the city.
  • set-ntp false turns synchronisation off: the clock will drift over time.

Differences from similar commands

  • date: shows or formats the date and can set it with -s, but does not manage the time zone persistently or NTP synchronisation.
  • hwclock: works with the hardware clock (RTC). timedatectl works with the system clock and its synchronisation.
  • hostnamectl: shows and changes the host name through the same systemd interface.

Related commands

FAQ

What is the RTC?

The hardware clock on the board, which keeps counting while the machine is off. timedatectl shows its time and whether it runs in UTC or local time.

Should the RTC be kept in UTC?

It is the recommended setting. The timedatectl documentation warns that local time in the RTC causes problems with daylight saving changes.

What does NTP mean here?

The protocol that syncs your clock with time servers over the network. timedatectl turns the service that does it on or off.

More System and processes commands

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course