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'
25 xmlns:xi="http://www.w3.org/2001/XInclude">
28 <title>timedatectl</title>
29 <productname>systemd</productname>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
42 <refentrytitle>timedatectl</refentrytitle>
43 <manvolnum>1</manvolnum>
47 <refname>timedatectl</refname>
48 <refpurpose>Control the system time and date</refpurpose>
53 <command>timedatectl <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="req">COMMAND</arg></command>
58 <title>Description</title>
60 <para><command>timedatectl</command> may be used to
61 query and change the system clock and its
66 <title>Options</title>
68 <para>The following options are understood:</para>
72 <term><option>--no-ask-password</option></term>
74 <listitem><para>Do not query the user
75 for authentication for privileged
76 operations.</para></listitem>
80 <term><option>--adjust-system-clock</option></term>
83 <command>set-local-rtc</command> is
84 invoked and this option is passed, the
85 system clock is synchronized from the
86 RTC again, taking the new setting into
87 account. Otherwise, the RTC is
88 synchronized from the system
89 clock.</para></listitem>
92 <xi:include href="user-system-options.xml" xpointer="host" />
93 <xi:include href="user-system-options.xml" xpointer="machine" />
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" />
100 <para>The following commands are understood:</para>
104 <term><command>status</command></term>
106 <listitem><para>Show current settings
107 of the system clock and
108 RTC.</para></listitem>
112 <term><command>set-time [TIME]</command></term>
114 <listitem><para>Set the system clock
115 to the specified time. This will also
116 update the RTC time accordingly. The time
117 may be specified in the format
119 18:17:16".</para></listitem>
123 <term><command>set-timezone [TIMEZONE]</command></term>
125 <listitem><para>Set the system time
126 zone to the specified value. Available
127 timezones can be listed with
128 <command>list-timezones</command>. If
129 the RTC is configured to be in the
130 local time, this will also update the
131 RTC time. This call will alter the
132 <filename>/etc/localtime</filename>
134 <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>
136 information.</para></listitem>
140 <term><command>list-timezones</command></term>
142 <listitem><para>List available time
143 zones, one per line. Entries from the
144 list can be set as the system
146 <command>set-timezone</command>.</para></listitem>
150 <term><command>set-local-rtc [BOOL]</command></term>
152 <listitem><para>Takes a boolean
153 argument. If <literal>0</literal>, the
154 system is configured to maintain the
155 RTC in universal time. If
156 <literal>1</literal>, it will maintain
157 the RTC in local time instead. Note
158 that maintaining the RTC in the local
159 timezone is not fully supported and
160 will create various problems with time
161 zone changes and daylight saving
162 adjustments. If at all possible, keep the
163 RTC in UTC mode. Note that invoking this
164 will also synchronize the RTC from the
166 <option>--adjust-system-clock</option> is
167 passed (see above). This command will
168 change the 3rd line of
169 <filename>/etc/adjtime</filename>, as
171 <citerefentry><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para></listitem>
175 <term><command>set-ntp [BOOL]</command></term>
177 <listitem><para>Takes a boolean
178 argument. Controls whether NTP based
179 network time synchronization is
181 available).</para></listitem>
189 <title>Exit status</title>
191 <para>On success, 0 is returned, a non-zero failure
192 code otherwise.</para>
195 <xi:include href="less-variables.xml" />
198 <title>Examples</title>
199 <para>Show current settings:
200 <programlisting>$ timedatectl
201 Local time: Fri, 2012-11-02 09:26:46 CET
202 Universal time: Fri, 2012-11-02 08:26:46 UTC
203 RTC time: Fri, 2012-11-02 08:26:45
204 Timezone: Europe/Warsaw
210 Last DST change: CEST → CET, DST became inactive
211 Sun, 2012-10-28 02:59:59 CEST
212 Sun, 2012-10-28 02:00:00 CET
213 Next DST change: CET → CEST, DST will become active
214 the clock will jump one hour forward
215 Sun, 2013-03-31 01:59:59 CET
216 Sun, 2013-03-31 03:00:00 CEST</programlisting>
219 <para>Enable an NTP daemon (chronyd):
220 <programlisting>$ timedatectl set-ntp true
221 ==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp ===
222 Authentication is required to control whether network time synchronization shall be enabled.
223 Authenticating as: user
225 ==== AUTHENTICATION COMPLETE ===</programlisting>
227 <programlisting>$ systemctl status chronyd.service
228 chronyd.service - NTP client/server
229 Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled)
230 Active: active (running) since Fri, 2012-11-02 09:36:25 CET; 5s ago
236 <title>See Also</title>
238 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
239 <citerefentry><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
240 <citerefentry><refentrytitle>date</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
241 <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
242 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
243 <citerefentry><refentrytitle>systemd-timedated.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>