timedatectl

Linux · System · reference only

What it does

Shows and changes the system date, time and time zone, and controls synchronization with NTP servers.

Syntax

timedatectl [opciones] [orden]

Options and parameters

  • status

    Shows local time, UTC, time zone and sync status.

  • set-timezone zona

    Changes the time zone, for example Europe/Madrid.

  • list-timezones

    Lists the available time zones.

  • set-ntp true|false

    Enables or disables automatic time synchronization.

  • set-time "fecha hora"

    Sets the time by hand; NTP must be disabled first.

  • show

    Shows the properties in a script-friendly format.

Usage examples

  • timedatectl status

    Shows the current time and whether the clock is synchronized.

  • timedatectl list-timezones | grep Madrid

    Looks up the exact name of the Madrid zone.

  • sudo timedatectl set-timezone Europe/Madrid

    Sets the mainland Spain time zone.

  • sudo timedatectl set-ntp true

    Enables automatic synchronization with time servers.

Notes and common mistakes

  • To set the time by hand with set-time, you must first disable NTP with set-ntp false.

Related commands