]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/timedatectl.xml
man: xinclude --help/--version/--no-pager
[thirdparty/systemd.git] / man / timedatectl.xml
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
24 <refentry id="timedatectl" conditional='ENABLE_TIMEDATED'
25 xmlns:xi="http://www.w3.org/2001/XInclude">
26
27 <refentryinfo>
28 <title>timedatectl</title>
29 <productname>systemd</productname>
30
31 <authorgroup>
32 <author>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
37 </author>
38 </authorgroup>
39 </refentryinfo>
40
41 <refmeta>
42 <refentrytitle>timedatectl</refentrytitle>
43 <manvolnum>1</manvolnum>
44 </refmeta>
45
46 <refnamediv>
47 <refname>timedatectl</refname>
48 <refpurpose>Control the system time and date</refpurpose>
49 </refnamediv>
50
51 <refsynopsisdiv>
52 <cmdsynopsis>
53 <command>timedatectl <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="req">COMMAND</arg></command>
54 </cmdsynopsis>
55 </refsynopsisdiv>
56
57 <refsect1>
58 <title>Description</title>
59
60 <para><command>timedatectl</command> may be used to
61 query and change the system clock and its
62 settings.</para>
63 </refsect1>
64
65 <refsect1>
66 <title>Options</title>
67
68 <para>The following options are understood:</para>
69
70 <variablelist>
71 <varlistentry>
72 <term><option>--no-ask-password</option></term>
73
74 <listitem><para>Do not query the user
75 for authentication for privileged
76 operations.</para></listitem>
77 </varlistentry>
78
79 <varlistentry>
80 <term><option>-H</option></term>
81 <term><option>--host=</option></term>
82
83 <listitem><para>Execute the operation
84 remotely. Specify a hostname, or
85 username and hostname separated by <literal>@</literal>,
86 to connect to. This will use SSH to
87 talk to the remote machine manager
88 instance.</para></listitem>
89 </varlistentry>
90
91 <varlistentry>
92 <term><option>-M</option></term>
93 <term><option>--machine=</option></term>
94
95 <listitem><para>Execute operation on a
96 local container. Specify a container
97 name to connect to.</para></listitem>
98 </varlistentry>
99
100 <varlistentry>
101 <term><option>--adjust-system-clock</option></term>
102
103 <listitem><para>If
104 <command>set-local-rtc</command> is
105 invoked and this option is passed, the
106 system clock is synchronized from the
107 RTC again, taking the new setting into
108 account. Otherwise, the RTC is
109 synchronized from the system
110 clock.</para></listitem>
111 </varlistentry>
112
113 <xi:include href="standard-options.xml" xpointer="help" />
114 <xi:include href="standard-options.xml" xpointer="version" />
115 <xi:include href="standard-options.xml" xpointer="no-pager" />
116 </variablelist>
117
118 <para>The following commands are understood:</para>
119
120 <variablelist>
121 <varlistentry>
122 <term><command>status</command></term>
123
124 <listitem><para>Show current settings
125 of the system clock and
126 RTC.</para></listitem>
127 </varlistentry>
128
129 <varlistentry>
130 <term><command>set-time [TIME]</command></term>
131
132 <listitem><para>Set the system clock
133 to the specified time. This will also
134 update the RTC time accordingly. The time
135 may be specified in the format
136 "2012-10-30
137 18:17:16".</para></listitem>
138 </varlistentry>
139
140 <varlistentry>
141 <term><command>set-timezone [TIMEZONE]</command></term>
142
143 <listitem><para>Set the system time
144 zone to the specified value. Available
145 timezones can be listed with
146 <command>list-timezones</command>. If
147 the RTC is configured to be in the
148 local time, this will also update the
149 RTC time. This call will alter the
150 <filename>/etc/localtime</filename>
151 symlink. See
152 <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>
153 for more
154 information.</para></listitem>
155 </varlistentry>
156
157 <varlistentry>
158 <term><command>list-timezones</command></term>
159
160 <listitem><para>List available time
161 zones, one per line. Entries from the
162 list can be set as the system
163 timezone with
164 <command>set-timezone</command>.</para></listitem>
165 </varlistentry>
166
167 <varlistentry>
168 <term><command>set-local-rtc [BOOL]</command></term>
169
170 <listitem><para>Takes a boolean
171 argument. If <literal>0</literal>, the
172 system is configured to maintain the
173 RTC in universal time. If
174 <literal>1</literal>, it will maintain
175 the RTC in local time instead. Note
176 that maintaining the RTC in the local
177 timezone is not fully supported and
178 will create various problems with time
179 zone changes and daylight saving
180 adjustments. If at all possible, keep the
181 RTC in UTC mode. Note that invoking this
182 will also synchronize the RTC from the
183 system clock, unless
184 <option>--adjust-system-clock</option> is
185 passed (see above). This command will
186 change the 3rd line of
187 <filename>/etc/adjtime</filename>, as
188 documented in
189 <citerefentry><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para></listitem>
190 </varlistentry>
191
192 <varlistentry>
193 <term><command>set-ntp [BOOL]</command></term>
194
195 <listitem><para>Takes a boolean
196 argument. Controls whether NTP based
197 network time synchronization is
198 enabled (if
199 available).</para></listitem>
200 </varlistentry>
201
202 </variablelist>
203
204 </refsect1>
205
206 <refsect1>
207 <title>Exit status</title>
208
209 <para>On success, 0 is returned, a non-zero failure
210 code otherwise.</para>
211 </refsect1>
212
213 <xi:include href="less-variables.xml" />
214
215 <refsect1>
216 <title>Examples</title>
217 <para>Show current settings:
218 <programlisting>$ timedatectl
219 Local time: Fri, 2012-11-02 09:26:46 CET
220 Universal time: Fri, 2012-11-02 08:26:46 UTC
221 RTC time: Fri, 2012-11-02 08:26:45
222 Timezone: Europe/Warsaw
223 UTC offset: +0100
224 NTP enabled: no
225 NTP synchronized: no
226 RTC in local TZ: no
227 DST active: no
228 Last DST change: CEST → CET, DST became inactive
229 Sun, 2012-10-28 02:59:59 CEST
230 Sun, 2012-10-28 02:00:00 CET
231 Next DST change: CET → CEST, DST will become active
232 the clock will jump one hour forward
233 Sun, 2013-03-31 01:59:59 CET
234 Sun, 2013-03-31 03:00:00 CEST</programlisting>
235 </para>
236
237 <para>Enable an NTP daemon (chronyd):
238 <programlisting>$ timedatectl set-ntp true
239 ==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp ===
240 Authentication is required to control whether network time synchronization shall be enabled.
241 Authenticating as: user
242 Password: ********
243 ==== AUTHENTICATION COMPLETE ===</programlisting>
244
245 <programlisting>$ systemctl status chronyd.service
246 chronyd.service - NTP client/server
247 Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled)
248 Active: active (running) since Fri, 2012-11-02 09:36:25 CET; 5s ago
249 ...</programlisting>
250 </para>
251 </refsect1>
252
253 <refsect1>
254 <title>See Also</title>
255 <para>
256 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
257 <citerefentry><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
258 <citerefentry><refentrytitle>date</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
259 <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
260 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
261 <citerefentry><refentrytitle>systemd-timedated.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
262 </para>
263 </refsect1>
264
265 </refentry>