timedatectl
Control the system time and date
- Provided by: systemd (Version: 237-3ubuntu10.57)
- Report a bug
Control the system time and date
timedatectl [OPTIONS...] {COMMAND}
timedatectl may be used to query and change the system clock and its settings.
Use systemd-firstboot(1) to initialize the system time zone for mounted (but not booted) system images.
The following options are understood:
--no-ask-password
--adjust-system-clock
-H, --host=
-M, --machine=
-h, --help
--version
--no-pager
The following commands are understood:
status
set-time [TIME]
set-timezone [TIMEZONE]
list-timezones
set-local-rtc [BOOL]
set-ntp [BOOL]
Note that even if time synchronization is turned off with this command, another unrelated system service might still synchronize the clock with the network. Also note that, strictly speaking, systemd-timesyncd.service does more than just network time synchronization, as it ensures a monotonic clock on systems without RTC even if no network is available. See systemd-timesyncd.service(8) for details about this.
On success, 0 is returned, a non-zero failure code otherwise.
$SYSTEMD_PAGER
$SYSTEMD_LESS
$SYSTEMD_LESSCHARSET
Show current settings:
$ timedatectl
Local time: Thu 2017-09-21 16:08:56 CEST
Universal time: Thu 2017-09-21 14:08:56 UTC
RTC time: Thu 2017-09-21 14:08:56
Time zone: Europe/Warsaw (CEST, +0200)
System clock synchronized: yes
systemd-timesyncd.service active: yes
RTC in local TZ: no
Enable network time synchronization:
$ timedatectl set-ntp true ==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp === Authentication is required to control whether network time synchronization shall be enabled. Authenticating as: user Password: ******** ==== AUTHENTICATION COMPLETE ===
$ systemctl status systemd-timesyncd.service
● systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled)
Active: active (running) since Mo 2015-03-30 14:20:38 CEST; 5s ago
Docs: man:systemd-timesyncd.service(8)
Main PID: 595 (systemd-timesyn)
Status: "Using Time Server 216.239.38.15:123 (time4.google.com)."
CGroup: /system.slice/systemd-timesyncd.service
└─595 /lib/systemd/systemd-timesyncd
...
systemd(1), hwclock(8), date(1), localtime(5), systemctl(1), systemd-timedated.service(8), systemd-timesyncd.service(8), systemd-firstboot(1)