timedatectl
Overview
timedatectl views and sets system time, timezone, and NTP synchronization via systemd.
Syntax
timedatectl [options] [command]Common Commands
| Command | Description |
|---|---|
status |
Show clock/NTP state (default) |
list-timezones |
Available zones |
set-timezone Zone |
Set zone |
set-time 'YYYY-MM-DD HH:MM:SS' |
Manual time |
set-ntp true\|false |
Enable systemd-timesyncd/NTP |
Examples with Explanations
timedatectl
timedatectl status
timedatectl list-timezones | grep -i america
sudo timedatectl set-timezone America/New_York
sudo timedatectl set-ntp true
timedatectl showCheck sync
timedatectl | grep -i ntp
# or
systemctl status systemd-timesyncd
# chrony users: chronyc trackingNotes
- Prefer NTP over manual
set-timeon networked hosts.
- RTC vs UTC:
timedatectl set-local-rtc 0recommended for Linux.
- Containers may inherit host time and restrict changes.