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
statusShows local time, UTC, time zone and sync status.
set-timezone zonaChanges the time zone, for example Europe/Madrid.
list-timezonesLists the available time zones.
set-ntp true|falseEnables or disables automatic time synchronization.
set-time "fecha hora"Sets the time by hand; NTP must be disabled first.
showShows the properties in a script-friendly format.
Usage examples
timedatectl statusShows the current time and whether the clock is synchronized.
timedatectl list-timezones | grep MadridLooks up the exact name of the Madrid zone.
sudo timedatectl set-timezone Europe/MadridSets the mainland Spain time zone.
sudo timedatectl set-ntp trueEnables 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.