]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/timedatectl.xml
Reindent man pages to 2ch
[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 query and
61 change the system clock and its settings.</para>
62
63 <para>Use
64 <citerefentry><refentrytitle>systemd-firstboot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
65 to initialize the system time zone for mounted (but not booted)
66 system images.</para>
67 </refsect1>
68
69 <refsect1>
70 <title>Options</title>
71
72 <para>The following options are understood:</para>
73
74 <variablelist>
75 <varlistentry>
76 <term><option>--no-ask-password</option></term>
77
78 <listitem><para>Do not query the user for authentication for
79 privileged operations.</para></listitem>
80 </varlistentry>
81
82 <varlistentry>
83 <term><option>--adjust-system-clock</option></term>
84
85 <listitem><para>If <command>set-local-rtc</command> is invoked
86 and this option is passed, the system clock is synchronized
87 from the RTC again, taking the new setting into account.
88 Otherwise, the RTC is synchronized from the system
89 clock.</para></listitem>
90 </varlistentry>
91
92 <xi:include href="user-system-options.xml" xpointer="host" />
93 <xi:include href="user-system-options.xml" xpointer="machine" />
94
95 <xi:include href="standard-options.xml" xpointer="help" />
96 <xi:include href="standard-options.xml" xpointer="version" />
97 <xi:include href="standard-options.xml" xpointer="no-pager" />
98 </variablelist>
99
100 <para>The following commands are understood:</para>
101
102 <variablelist>
103 <varlistentry>
104 <term><command>status</command></term>
105
106 <listitem><para>Show current settings
107 of the system clock and
108 RTC.</para></listitem>
109 </varlistentry>
110
111 <varlistentry>
112 <term><command>set-time [TIME]</command></term>
113
114 <listitem><para>Set the system clock to the specified time.
115 This will also update the RTC time accordingly. The time may
116 be specified in the format "2012-10-30
117 18:17:16".</para></listitem>
118 </varlistentry>
119
120 <varlistentry>
121 <term><command>set-timezone [TIMEZONE]</command></term>
122
123 <listitem><para>Set the system time zone to the specified
124 value. Available timezones can be listed with
125 <command>list-timezones</command>. If the RTC is configured to
126 be in the local time, this will also update the RTC time. This
127 call will alter the <filename>/etc/localtime</filename>
128 symlink. See
129 <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>
130 for more information.</para></listitem>
131 </varlistentry>
132
133 <varlistentry>
134 <term><command>list-timezones</command></term>
135
136 <listitem><para>List available time zones, one per line.
137 Entries from the list can be set as the system timezone with
138 <command>set-timezone</command>.</para></listitem>
139 </varlistentry>
140
141 <varlistentry>
142 <term><command>set-local-rtc [BOOL]</command></term>
143
144 <listitem><para>Takes a boolean argument. If
145 <literal>0</literal>, the system is configured to maintain the
146 RTC in universal time. If <literal>1</literal>, it will
147 maintain the RTC in local time instead. Note that maintaining
148 the RTC in the local timezone is not fully supported and will
149 create various problems with time zone changes and daylight
150 saving adjustments. If at all possible, keep the RTC in UTC
151 mode. Note that invoking this will also synchronize the RTC
152 from the system clock, unless
153 <option>--adjust-system-clock</option> is passed (see above).
154 This command will change the 3rd line of
155 <filename>/etc/adjtime</filename>, as documented in
156 <citerefentry project='man-pages'><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
157 </para></listitem>
158 </varlistentry>
159
160 <varlistentry>
161 <term><command>set-ntp [BOOL]</command></term>
162
163 <listitem><para>Takes a boolean argument. Controls whether NTP
164 based network time synchronization is enabled (if
165 available).</para></listitem>
166 </varlistentry>
167
168 </variablelist>
169
170 </refsect1>
171
172 <refsect1>
173 <title>Exit status</title>
174
175 <para>On success, 0 is returned, a non-zero failure
176 code otherwise.</para>
177 </refsect1>
178
179 <xi:include href="less-variables.xml" />
180
181 <refsect1>
182 <title>Examples</title>
183 <para>Show current settings:
184 <programlisting>$ timedatectl
185 Local time: Fri, 2012-11-02 09:26:46 CET
186 Universal time: Fri, 2012-11-02 08:26:46 UTC
187 RTC time: Fri, 2012-11-02 08:26:45
188 Timezone: Europe/Warsaw
189 UTC offset: +0100
190 NTP enabled: no
191 NTP synchronized: no
192 RTC in local TZ: no
193 DST active: no
194 Last DST change: CEST → CET, DST became inactive
195 Sun, 2012-10-28 02:59:59 CEST
196 Sun, 2012-10-28 02:00:00 CET
197 Next DST change: CET → CEST, DST will become active
198 the clock will jump one hour forward
199 Sun, 2013-03-31 01:59:59 CET
200 Sun, 2013-03-31 03:00:00 CEST</programlisting>
201 </para>
202
203 <para>Enable an NTP daemon (chronyd):
204 <programlisting>$ timedatectl set-ntp true
205 ==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp ===
206 Authentication is required to control whether network time synchronization shall be enabled.
207 Authenticating as: user
208 Password: ********
209 ==== AUTHENTICATION COMPLETE ===</programlisting>
210
211 <programlisting>$ systemctl status chronyd.service
212 chronyd.service - NTP client/server
213 Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled)
214 Active: active (running) since Fri, 2012-11-02 09:36:25 CET; 5s ago
215 ...</programlisting>
216 </para>
217 </refsect1>
218
219 <refsect1>
220 <title>See Also</title>
221 <para>
222 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
223 <citerefentry project='man-pages'><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
224 <citerefentry project='man-pages'><refentrytitle>date</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
225 <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
226 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
227 <citerefentry><refentrytitle>systemd-timedated.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
228 <citerefentry><refentrytitle>systemd-firstboot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
229 </para>
230 </refsect1>
231
232 </refentry>