]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/timedatectl.xml
Fix spelling errors using 'codespell' tool
[thirdparty/systemd.git] / man / timedatectl.xml
CommitLineData
6d0274f1
LP
1<?xml version='1.0'?> <!--*-nxml-*-->
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5<!--
6 This file is part of systemd.
7
8 Copyright 2012 Lennart Poettering
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22-->
23
56ba3c78 24<refentry id="timedatectl" conditional='ENABLE_TIMEDATED'>
6d0274f1
LP
25
26 <refentryinfo>
27 <title>timedatectl</title>
28 <productname>systemd</productname>
29
30 <authorgroup>
31 <author>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
36 </author>
37 </authorgroup>
38 </refentryinfo>
39
40 <refmeta>
41 <refentrytitle>timedatectl</refentrytitle>
42 <manvolnum>1</manvolnum>
43 </refmeta>
44
45 <refnamediv>
46 <refname>timedatectl</refname>
47 <refpurpose>Control the system time and date</refpurpose>
48 </refnamediv>
49
50 <refsynopsisdiv>
51 <cmdsynopsis>
52 <command>timedatectl <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="req">COMMAND</arg></command>
53 </cmdsynopsis>
54 </refsynopsisdiv>
55
56 <refsect1>
57 <title>Description</title>
58
59 <para><command>timedatectl</command> may be used to
60 query and change the system clock and its
61 settings.</para>
62 </refsect1>
63
64 <refsect1>
65 <title>Options</title>
66
67 <para>The following options are understood:</para>
68
69 <variablelist>
70 <varlistentry>
6d0274f1 71 <term><option>-h</option></term>
a7f5bb1e 72 <term><option>--help</option></term>
6d0274f1
LP
73
74 <listitem><para>Prints a short help
75 text and exits.</para></listitem>
76 </varlistentry>
77
78 <varlistentry>
79 <term><option>--version</option></term>
80
81 <listitem><para>Prints a short version
82 string and exits.</para></listitem>
83 </varlistentry>
84
85 <varlistentry>
86 <term><option>--no-pager</option></term>
87
88 <listitem><para>Do not pipe output into a
89 pager.</para></listitem>
90 </varlistentry>
91
92 <varlistentry>
93 <term><option>--no-ask-password</option></term>
94
95 <listitem><para>Don't query the user
96 for authentication for privileged
97 operations.</para></listitem>
98 </varlistentry>
99
100 <varlistentry>
101 <term><option>-H</option></term>
102 <term><option>--host</option></term>
103
5a5c72ca 104 <listitem><para>Execute the operation
6d0274f1
LP
105 remotely. Specify a hostname, or
106 username and hostname separated by @,
107 to connect to. This will use SSH to
108 talk to a remote
109 system.</para></listitem>
110 </varlistentry>
111
112 <varlistentry>
c9783430 113 <term><option>--adjust-system-clock</option></term>
6d0274f1
LP
114
115 <listitem><para>If
116 <command>set-local-rtc</command> is
117 invoked and this option is passed the
118 system clock is synchronized from the
119 RTC again, taking the new setting into
120 account. Otherwise the RTC is
5a5c72ca 121 synchronized from the system
6d0274f1
LP
122 clock.</para></listitem>
123 </varlistentry>
124 </variablelist>
125
126 <para>The following commands are understood:</para>
127
128 <variablelist>
129 <varlistentry>
130 <term><command>status</command></term>
131
132 <listitem><para>Show current settings
133 of the system clock and
134 RTC.</para></listitem>
135 </varlistentry>
136
137 <varlistentry>
138 <term><command>set-time [TIME]</command></term>
139
140 <listitem><para>Set the system clock
141 to the specified time. This will also
142 update the RTC time accordingly. The time
143 may be specified in the format
144 "2012-10-30
145 18:17:16".</para></listitem>
146 </varlistentry>
147
148 <varlistentry>
149 <term><command>set-timezone [TIMEZONE]</command></term>
150
151 <listitem><para>Set the system time
152 zone to the specified value. Available
5a5c72ca 153 time zones can be listed with
6d0274f1
LP
154 <command>list-timezones</command>. If
155 the RTC is configured to be in the
156 local time this will also update the
dbc4fbae
LP
157 RTC time. This call will alter the
158 <filename>/etc/localtime</filename>
159 symlink. See
160 <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>
161 for more
162 information.</para></listitem>
6d0274f1
LP
163 </varlistentry>
164
165 <varlistentry>
166 <term><command>list-timezones</command></term>
167
168 <listitem><para>List available time
169 zones, one per line. Entries from the
5a5c72ca
TA
170 list can be set as the system
171 time zone with
6d0274f1
LP
172 <command>set-timezone</command>.</para></listitem>
173 </varlistentry>
174
175 <varlistentry>
176 <term><command>set-local-rtc [BOOL]</command></term>
177
178 <listitem><para>Takes a boolean
179 argument. If <literal>0</literal> the
180 system is configured to maintain the
181 RTC in universal time, if
182 <literal>1</literal> it will maintain
183 the RTC in local time instead. Note
184 that maintaining the RTC in the local
5a5c72ca 185 time zone is not fully supported and
6d0274f1
LP
186 will create various problems with time
187 zone changes and daylight saving
188 adjustments. If at all possible use
189 RTC in UTC. Note that invoking this
190 will also synchronize the RTC from the
191 system clock, unless
c9783430 192 <option>--adjust-system-clock</option> is
6d0274f1
LP
193 passed (see above). This command will
194 change the 3rd line of
195 <filename>/etc/adjtime</filename>, as
196 documented in
197 <citerefentry><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para></listitem>
198 </varlistentry>
199
200 <varlistentry>
201 <term><command>set-ntp [BOOL]</command></term>
202
203 <listitem><para>Takes a boolean
204 argument. Controls whether NTP based
205 network time synchronization is
206 enabled (if
207 available).</para></listitem>
208 </varlistentry>
209
210 </variablelist>
211
212 </refsect1>
213
214 <refsect1>
215 <title>Exit status</title>
216
217 <para>On success 0 is returned, a non-zero failure
218 code otherwise.</para>
219 </refsect1>
220
221 <refsect1>
222 <title>Environment</title>
223
ccc9a4f9 224 <variablelist class='environment-variables'>
6d0274f1
LP
225 <varlistentry>
226 <term><varname>$SYSTEMD_PAGER</varname></term>
227 <listitem><para>Pager to use when
228 <option>--no-pager</option> is not given;
229 overrides <varname>$PAGER</varname>. Setting
230 this to an empty string or the value
231 <literal>cat</literal> is equivalent to passing
232 <option>--no-pager</option>.</para></listitem>
233 </varlistentry>
234 </variablelist>
235 </refsect1>
236
be1015dd
ZJS
237 <refsect1>
238 <title>Examples</title>
239 <para>Show current settings:
240 <programlisting>
241$ timedatectl
242 Local time: Fri, 2012-11-02 09:26:46 CET
243 Universal time: Fri, 2012-11-02 08:26:46 UTC
244 RTC time: Fri, 2012-11-02 08:26:45
245 Timezone: Europe/Warsaw
246 UTC offset: +0100
247 NTP enabled: no
248NTP synchronized: no
249 RTC in local TZ: no
250 DST active: no
251 Last DST change: CEST → CET, DST became inactive
252 Sun, 2012-10-28 02:59:59 CEST
253 Sun, 2012-10-28 02:00:00 CET
254 Next DST change: CET → CEST, DST will become active
255 the clock will jump one hour forward
256 Sun, 2013-03-31 01:59:59 CET
257 Sun, 2013-03-31 03:00:00 CEST
258 </programlisting>
259 </para>
260
261 <para>Enable an NTP daemon (chronyd):
262 <programlisting>
263$ timedatectl set-ntp true
264==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp ===
265Authentication is required to control whether network time synchronization shall be enabled.
266Authenticating as: user
267Password: ********
268==== AUTHENTICATION COMPLETE ===
269 </programlisting>
270
271 <programlisting>
272$ systemctl status chronyd.service
273chronyd.service - NTP client/server
274 Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled)
275 Active: active (running) since Fri, 2012-11-02 09:36:25 CET; 5s ago
276...
277 </programlisting>
278 </para>
279 </refsect1>
280
6d0274f1
LP
281 <refsect1>
282 <title>See Also</title>
283 <para>
284 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
285 <citerefentry><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
286 <citerefentry><refentrytitle>date</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
dbc4fbae 287 <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
6d0274f1
LP
288 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
289 <citerefentry><refentrytitle>systemd-timedated.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
290 </para>
291 </refsect1>
292
293</refentry>