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">
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>--help</option></term>
72 <term><option>-h</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>Don't query the user
96 for authentication for privileged
97 operations.</para></listitem>
101 <term><option>-H</option></term>
102 <term><option>--host</option></term>
104 <listitem><para>Execute operation
105 remotely. Specify a hostname, or
106 username and hostname separated by @,
107 to connect to. This will use SSH to
109 system.</para></listitem>
113 <term><option>--fix-system</option></term>
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
121 synchonized from the system
122 clock.</para></listitem>
126 <para>The following commands are understood:</para>
130 <term><command>status</command></term>
132 <listitem><para>Show current settings
133 of the system clock and
134 RTC.</para></listitem>
138 <term><command>set-time [TIME]</command></term>
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
145 18:17:16".</para></listitem>
149 <term><command>set-timezone [TIMEZONE]</command></term>
151 <listitem><para>Set the system time
152 zone to the specified value. Available
153 time zones my be listed with
154 <command>list-timezones</command>. If
155 the RTC is configured to be in the
156 local time this will also update the
157 RTC time.</para></listitem>
161 <term><command>list-timezones</command></term>
163 <listitem><para>List available time
164 zones, one per line. Entries from the
165 list may selected as the system
167 <command>set-timezone</command>.</para></listitem>
171 <term><command>set-local-rtc [BOOL]</command></term>
173 <listitem><para>Takes a boolean
174 argument. If <literal>0</literal> the
175 system is configured to maintain the
176 RTC in universal time, if
177 <literal>1</literal> it will maintain
178 the RTC in local time instead. Note
179 that maintaining the RTC in the local
180 timezone is is not fully supported and
181 will create various problems with time
182 zone changes and daylight saving
183 adjustments. If at all possible use
184 RTC in UTC. Note that invoking this
185 will also synchronize the RTC from the
187 <option>--fix-system</option> is
188 passed (see above). This command will
189 change the 3rd line of
190 <filename>/etc/adjtime</filename>, as
192 <citerefentry><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para></listitem>
196 <term><command>set-ntp [BOOL]</command></term>
198 <listitem><para>Takes a boolean
199 argument. Controls whether NTP based
200 network time synchronization is
202 available).</para></listitem>
210 <title>Exit status</title>
212 <para>On success 0 is returned, a non-zero failure
213 code otherwise.</para>
217 <title>Environment</title>
221 <term><varname>$SYSTEMD_PAGER</varname></term>
222 <listitem><para>Pager to use when
223 <option>--no-pager</option> is not given;
224 overrides <varname>$PAGER</varname>. Setting
225 this to an empty string or the value
226 <literal>cat</literal> is equivalent to passing
227 <option>--no-pager</option>.</para></listitem>
233 <title>See Also</title>
235 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
236 <citerefentry><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
237 <citerefentry><refentrytitle>date</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
238 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
239 <citerefentry><refentrytitle>systemd-timedated.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>