$linuxjunkies
>

timedatectl(1)

Query and change the system time and date settings, timezone, and NTP synchronization status.

UbuntuDebianFedoraArch

Synopsis

timedatectl [OPTIONS...] COMMAND

Description

timedatectl is a systemd utility for managing the system clock and timezone settings. It queries and modifies the hardware clock (RTC), system time, timezone, and NTP (Network Time Protocol) synchronization status.

Changes made with timedatectl persist across reboots. The command communicates with systemd-timedated, the system service responsible for time and date settings.

Common options

FlagWhat it does
--no-ask-passwordDo not prompt for password when performing privileged operations
--adjust-system-clockSynchronize the hardware clock to the system time when setting the system time
-H, --host=HOSTExecute operations on a remote host via SSH
-M, --machine=CONTAINERExecute operations in a local container or virtual machine
--monitorMonitor time and clock synchronization status changes in real-time
-p, --property=NAMEShow only specified properties when querying status
--valueWhen showing properties, print only the value (not the property name)
-a, --allShow all properties, including default ones

Examples

Display current time, timezone, NTP status, and whether hardware clock is in UTC

timedatectl

Change the system timezone to Eastern Time (requires root or sudo)

timedatectl set-timezone America/New_York

Show all available timezone names you can set

timedatectl list-timezones

Set the system date and time manually (requires root or sudo)

timedatectl set-time '2024-01-15 14:30:00'

Enable automatic time synchronization via NTP (requires root or sudo)

timedatectl set-ntp true

Configure the hardware clock to use local time instead of UTC (requires root)

timedatectl set-local-rtc 1

Display detailed NTP synchronization status and timing statistics

timedatectl show-timesync

Show the same information as calling timedatectl with no arguments

timedatectl status

Related commands