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">
6 This file is part of systemd.
8 Copyright 2012 Lennart Poettering
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.
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.
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/>.
24 <refentry id="timedatectl" conditional='ENABLE_TIMEDATED'>
27 <title>timedatectl</title>
28 <productname>systemd</productname>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
41 <refentrytitle>timedatectl</refentrytitle>
42 <manvolnum>1</manvolnum>
46 <refname>timedatectl</refname>
47 <refpurpose>Control the system time and date</refpurpose>
52 <command>timedatectl <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="req">COMMAND</arg></command>
57 <title>Description</title>
59 <para><command>timedatectl</command> may be used to
60 query and change the system clock and its
65 <title>Options</title>
67 <para>The following options are understood:</para>
71 <term><option>-h</option></term>
72 <term><option>--help</option></term>
74 <listitem><para>Prints a short help
75 text and exits.</para></listitem>
79 <term><option>--version</option></term>
81 <listitem><para>Prints a short version
82 string and exits.</para></listitem>
86 <term><option>--no-pager</option></term>
88 <listitem><para>Do not pipe output into a
89 pager.</para></listitem>
93 <term><option>--no-ask-password</option></term>
95 <listitem><para>Do not query the user
96 for authentication for privileged
97 operations.</para></listitem>
101 <term><option>-P</option></term>
102 <term><option>--privileged</option></term>
104 <listitem><para>Acquire privileges via PolicyKit
105 before executing the operation.</para></listitem>
109 <term><option>-H</option></term>
110 <term><option>--host</option></term>
112 <listitem><para>Execute the operation
113 remotely. Specify a hostname, or
114 username and hostname separated by <literal>@</literal>,
115 to connect to. This will use SSH to
117 system.</para></listitem>
121 <term><option>--adjust-system-clock</option></term>
124 <command>set-local-rtc</command> is
125 invoked and this option is passed the
126 system clock is synchronized from the
127 RTC again, taking the new setting into
128 account. Otherwise the RTC is
129 synchronized from the system
130 clock.</para></listitem>
134 <para>The following commands are understood:</para>
138 <term><command>status</command></term>
140 <listitem><para>Show current settings
141 of the system clock and
142 RTC.</para></listitem>
146 <term><command>set-time [TIME]</command></term>
148 <listitem><para>Set the system clock
149 to the specified time. This will also
150 update the RTC time accordingly. The time
151 may be specified in the format
153 18:17:16".</para></listitem>
157 <term><command>set-timezone [TIMEZONE]</command></term>
159 <listitem><para>Set the system time
160 zone to the specified value. Available
161 timezones can be listed with
162 <command>list-timezones</command>. If
163 the RTC is configured to be in the
164 local time this will also update the
165 RTC time. This call will alter the
166 <filename>/etc/localtime</filename>
168 <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>
170 information.</para></listitem>
174 <term><command>list-timezones</command></term>
176 <listitem><para>List available time
177 zones, one per line. Entries from the
178 list can be set as the system
180 <command>set-timezone</command>.</para></listitem>
184 <term><command>set-local-rtc [BOOL]</command></term>
186 <listitem><para>Takes a boolean
187 argument. If <literal>0</literal> the
188 system is configured to maintain the
189 RTC in universal time, if
190 <literal>1</literal> it will maintain
191 the RTC in local time instead. Note
192 that maintaining the RTC in the local
193 timezone is not fully supported and
194 will create various problems with time
195 zone changes and daylight saving
196 adjustments. If at all possible use
197 RTC in UTC. Note that invoking this
198 will also synchronize the RTC from the
200 <option>--adjust-system-clock</option> is
201 passed (see above). This command will
202 change the 3rd line of
203 <filename>/etc/adjtime</filename>, as
205 <citerefentry><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para></listitem>
209 <term><command>set-ntp [BOOL]</command></term>
211 <listitem><para>Takes a boolean
212 argument. Controls whether NTP based
213 network time synchronization is
215 available).</para></listitem>
223 <title>Exit status</title>
225 <para>On success 0 is returned, a non-zero failure
226 code otherwise.</para>
230 <title>Environment</title>
232 <variablelist class='environment-variables'>
234 <term><varname>$SYSTEMD_PAGER</varname></term>
235 <listitem><para>Pager to use when
236 <option>--no-pager</option> is not given;
237 overrides <varname>$PAGER</varname>. Setting
238 this to an empty string or the value
239 <literal>cat</literal> is equivalent to passing
240 <option>--no-pager</option>.</para></listitem>
246 <title>Examples</title>
247 <para>Show current settings:
250 Local time: Fri, 2012-11-02 09:26:46 CET
251 Universal time: Fri, 2012-11-02 08:26:46 UTC
252 RTC time: Fri, 2012-11-02 08:26:45
253 Timezone: Europe/Warsaw
259 Last DST change: CEST → CET, DST became inactive
260 Sun, 2012-10-28 02:59:59 CEST
261 Sun, 2012-10-28 02:00:00 CET
262 Next DST change: CET → CEST, DST will become active
263 the clock will jump one hour forward
264 Sun, 2013-03-31 01:59:59 CET
265 Sun, 2013-03-31 03:00:00 CEST
269 <para>Enable an NTP daemon (chronyd):
271 $ timedatectl set-ntp true
272 ==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp ===
273 Authentication is required to control whether network time synchronization shall be enabled.
274 Authenticating as: user
276 ==== AUTHENTICATION COMPLETE ===
280 $ systemctl status chronyd.service
281 chronyd.service - NTP client/server
282 Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled)
283 Active: active (running) since Fri, 2012-11-02 09:36:25 CET; 5s ago
290 <title>See Also</title>
292 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
293 <citerefentry><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
294 <citerefentry><refentrytitle>date</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
295 <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
296 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
297 <citerefentry><refentrytitle>systemd-timedated.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>