1TIMEDATECTL(1) timedatectl TIMEDATECTL(1)
2
3
4
6 timedatectl - Control the system time and date
7
9 timedatectl [OPTIONS...] {COMMAND}
10
12 timedatectl may be used to query and change the system clock and its
13 settings.
14
15 Use systemd-firstboot(1) to initialize the system time zone for mounted
16 (but not booted) system images.
17
18 timedatectl may be used to show the current status of systemd-
19 timesyncd.service(8).
20
22 The following options are understood:
23
24 --no-ask-password
25 Do not query the user for authentication for privileged operations.
26
27 --adjust-system-clock
28 If set-local-rtc is invoked and this option is passed, the system
29 clock is synchronized from the RTC again, taking the new setting
30 into account. Otherwise, the RTC is synchronized from the system
31 clock.
32
33 --monitor
34 If timesync-status is invoked and this option is passed, then
35 timedatectl monitors the status of systemd-timesyncd.service(8) and
36 updates the outputs. Use Ctrl-C to terminate the monitoring.
37
38 -a, -all
39 When showing properties of systemd-timesyncd.service(8), show all
40 properties regardless of whether they are set or not.
41
42 -p, --property=
43 When showing properties of systemd-timesyncd.service(8), limit
44 display to certain properties as specified as argument. If not
45 specified, all set properties are shown. The argument should be a
46 property name, such as "ServerName". If specified more than once,
47 all properties with the specified names are shown.
48
49 --value
50 When printing properties with show-timesync, only print the value,
51 and skip the property name and "=".
52
53 -H, --host=
54 Execute the operation remotely. Specify a hostname, or a username
55 and hostname separated by "@", to connect to. The hostname may
56 optionally be suffixed by a container name, separated by ":", which
57 connects directly to a specific container on the specified host.
58 This will use SSH to talk to the remote machine manager instance.
59 Container names may be enumerated with machinectl -H HOST.
60
61 -M, --machine=
62 Execute operation on a local container. Specify a container name to
63 connect to.
64
65 -h, --help
66 Print a short help text and exit.
67
68 --version
69 Print a short version string and exit.
70
71 --no-pager
72 Do not pipe output into a pager.
73
75 The following commands are understood:
76
77 status
78 Show current settings of the system clock and RTC, including
79 whether network time synchronization through
80 systemd-timesyncd.service is active. Even if it is inactive, a
81 different service might still synchronize the clock. If no command
82 is specified, this is the implied default.
83
84 show
85 Show the same information as status, but in machine readable form.
86 This command is intended to be used whenever computer-parsable
87 output is required. Use status if you are looking for formatted
88 human-readable output.
89
90 By default, empty properties are suppressed. Use --all to show
91 those too. To select specific properties to show, use --property=.
92
93 set-time [TIME]
94 Set the system clock to the specified time. This will also update
95 the RTC time accordingly. The time may be specified in the format
96 "2012-10-30 18:17:16".
97
98 set-timezone [TIMEZONE]
99 Set the system time zone to the specified value. Available
100 timezones can be listed with list-timezones. If the RTC is
101 configured to be in the local time, this will also update the RTC
102 time. This call will alter the /etc/localtime symlink. See
103 localtime(5) for more information.
104
105 list-timezones
106 List available time zones, one per line. Entries from the list can
107 be set as the system timezone with set-timezone.
108
109 set-local-rtc [BOOL]
110 Takes a boolean argument. If "0", the system is configured to
111 maintain the RTC in universal time. If "1", it will maintain the
112 RTC in local time instead. Note that maintaining the RTC in the
113 local timezone is not fully supported and will create various
114 problems with time zone changes and daylight saving adjustments. If
115 at all possible, keep the RTC in UTC mode. Note that invoking this
116 will also synchronize the RTC from the system clock, unless
117 --adjust-system-clock is passed (see above). This command will
118 change the 3rd line of /etc/adjtime, as documented in hwclock(8).
119
120 set-ntp [BOOL]
121 Takes a boolean argument. Controls whether network time
122 synchronization is active and enabled (if available). If the
123 argument is true, this enables and starts the first existed service
124 listed in the environment variable $SYSTEMD_TIMEDATED_NTP_SERVICES
125 of systemd-timedated.service. If the argument is false, then this
126 disables and stops the all services listed in
127 $SYSTEMD_TIMEDATED_NTP_SERVICES.
128
129 systemd-timesyncd Commands
130 The following commands are specific to systemd-timesyncd.service(8).
131
132 timesync-status
133 Show current status of systemd-timesyncd.service(8). If --monitor
134 is specified, then this will monitor the status updates.
135
136 show-timesync
137 Show the same information as timesync-status, but in machine
138 readable form. This command is intended to be used whenever
139 computer-parsable output is required. Use timesync-status if you
140 are looking for formatted human-readable output.
141
142 By default, empty properties are suppressed. Use --all to show
143 those too. To select specific properties to show, use --property=.
144
146 On success, 0 is returned, a non-zero failure code otherwise.
147
149 $SYSTEMD_PAGER
150 Pager to use when --no-pager is not given; overrides $PAGER. If
151 neither $SYSTEMD_PAGER nor $PAGER are set, a set of well-known
152 pager implementations are tried in turn, including less(1) and
153 more(1), until one is found. If no pager implementation is
154 discovered no pager is invoked. Setting this environment variable
155 to an empty string or the value "cat" is equivalent to passing
156 --no-pager.
157
158 $SYSTEMD_LESS
159 Override the options passed to less (by default "FRSXMK").
160
161 $SYSTEMD_LESSCHARSET
162 Override the charset passed to less (by default "utf-8", if the
163 invoking terminal is determined to be UTF-8 compatible).
164
166 Show current settings:
167
168 $ timedatectl
169 Local time: Thu 2017-09-21 16:08:56 CEST
170 Universal time: Thu 2017-09-21 14:08:56 UTC
171 RTC time: Thu 2017-09-21 14:08:56
172 Time zone: Europe/Warsaw (CEST, +0200)
173 System clock synchronized: yes
174 NTP service: active
175 RTC in local TZ: no
176
177 Enable network time synchronization:
178
179 $ timedatectl set-ntp true
180 ==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp ===
181 Authentication is required to control whether network time synchronization shall be enabled.
182 Authenticating as: user
183 Password: ********
184 ==== AUTHENTICATION COMPLETE ===
185
186
187
188 $ systemctl status systemd-timesyncd.service
189 ● systemd-timesyncd.service - Network Time Synchronization
190 Loaded: loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled)
191 Active: active (running) since Mo 2015-03-30 14:20:38 CEST; 5s ago
192 Docs: man:systemd-timesyncd.service(8)
193 Main PID: 595 (systemd-timesyn)
194 Status: "Using Time Server 216.239.38.15:123 (time4.google.com)."
195 CGroup: /system.slice/systemd-timesyncd.service
196 └─595 /usr/lib/systemd/systemd-timesyncd
197 ...
198
199 Show current status of systemd-timesyncd.service(8):
200
201 $ timedatectl timesync-status
202 Server: 216.239.38.15 (time4.google.com)
203 Poll interval: 1min 4s (min: 32s; max 34min 8s)
204 Leap: normal
205 Version: 4
206 Stratum: 1
207 Reference: GPS
208 Precision: 1us (-20)
209 Root distance: 335us (max: 5s)
210 Offset: +316us
211 Delay: 349us
212 Jitter: 0
213 Packet count: 1
214 Frequency: -8.802ppm
215
216
218 systemd(1), hwclock(8), date(1), localtime(5), systemctl(1), systemd-
219 timedated.service(8), systemd-timesyncd.service(8), systemd-
220 firstboot(1)
221
222
223
224systemd 239 TIMEDATECTL(1)