]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/timedatectl.xml
Merge pull request #288 from phomes/cgroup-util
[thirdparty/systemd.git] / man / timedatectl.xml
CommitLineData
6d0274f1
LP
1<?xml version='1.0'?> <!--*-nxml-*-->
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
681eb9cf
FB
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4<!ENTITY % entities SYSTEM "custom-entities.ent" >
5%entities;
6]>
6d0274f1
LP
7
8<!--
9 This file is part of systemd.
10
11 Copyright 2012 Lennart Poettering
12
13 systemd is free software; you can redistribute it and/or modify it
14 under the terms of the GNU Lesser General Public License as published by
15 the Free Software Foundation; either version 2.1 of the License, or
16 (at your option) any later version.
17
18 systemd is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public License
24 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25-->
26
21ac6ff1 27<refentry id="timedatectl" conditional='ENABLE_TIMEDATED'
798d3a52
ZJS
28 xmlns:xi="http://www.w3.org/2001/XInclude">
29
30 <refentryinfo>
31 <title>timedatectl</title>
32 <productname>systemd</productname>
33
34 <authorgroup>
35 <author>
36 <contrib>Developer</contrib>
37 <firstname>Lennart</firstname>
38 <surname>Poettering</surname>
39 <email>lennart@poettering.net</email>
40 </author>
41 </authorgroup>
42 </refentryinfo>
43
44 <refmeta>
45 <refentrytitle>timedatectl</refentrytitle>
46 <manvolnum>1</manvolnum>
47 </refmeta>
48
49 <refnamediv>
50 <refname>timedatectl</refname>
51 <refpurpose>Control the system time and date</refpurpose>
52 </refnamediv>
53
54 <refsynopsisdiv>
55 <cmdsynopsis>
56 <command>timedatectl <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="req">COMMAND</arg></command>
57 </cmdsynopsis>
58 </refsynopsisdiv>
59
60 <refsect1>
61 <title>Description</title>
62
63 <para><command>timedatectl</command> may be used to query and
64 change the system clock and its settings.</para>
65
66 <para>Use
67 <citerefentry><refentrytitle>systemd-firstboot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
68 to initialize the system time zone for mounted (but not booted)
69 system images.</para>
70 </refsect1>
71
72 <refsect1>
73 <title>Options</title>
74
75 <para>The following options are understood:</para>
76
77 <variablelist>
78 <varlistentry>
79 <term><option>--no-ask-password</option></term>
80
81 <listitem><para>Do not query the user for authentication for
82 privileged operations.</para></listitem>
83 </varlistentry>
84
85 <varlistentry>
86 <term><option>--adjust-system-clock</option></term>
87
88 <listitem><para>If <command>set-local-rtc</command> is invoked
89 and this option is passed, the system clock is synchronized
90 from the RTC again, taking the new setting into account.
91 Otherwise, the RTC is synchronized from the system
92 clock.</para></listitem>
93 </varlistentry>
94
95 <xi:include href="user-system-options.xml" xpointer="host" />
96 <xi:include href="user-system-options.xml" xpointer="machine" />
97
98 <xi:include href="standard-options.xml" xpointer="help" />
99 <xi:include href="standard-options.xml" xpointer="version" />
100 <xi:include href="standard-options.xml" xpointer="no-pager" />
101 </variablelist>
102
103 <para>The following commands are understood:</para>
104
105 <variablelist>
106 <varlistentry>
107 <term><command>status</command></term>
108
ff5921ba 109 <listitem><para>Show current settings of the system clock and
2fc4f5bd 110 RTC, including whether network time synchronization is
b90930c7 111 on. Note that whether network time synchronization is on
ff5921ba 112 simply reflects whether the
57506e7d 113 <filename>systemd-timesyncd.service</filename> unit is
b90930c7
LP
114 enabled. Even if this command shows the status as off a
115 different service might still synchronize the clock with the
2fc4f5bd 116 network.</para></listitem>
798d3a52
ZJS
117 </varlistentry>
118
119 <varlistentry>
120 <term><command>set-time [TIME]</command></term>
121
122 <listitem><para>Set the system clock to the specified time.
123 This will also update the RTC time accordingly. The time may
124 be specified in the format "2012-10-30
125 18:17:16".</para></listitem>
126 </varlistentry>
127
128 <varlistentry>
129 <term><command>set-timezone [TIMEZONE]</command></term>
130
131 <listitem><para>Set the system time zone to the specified
132 value. Available timezones can be listed with
133 <command>list-timezones</command>. If the RTC is configured to
134 be in the local time, this will also update the RTC time. This
135 call will alter the <filename>/etc/localtime</filename>
136 symlink. See
137 <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>
138 for more information.</para></listitem>
139 </varlistentry>
140
141 <varlistentry>
142 <term><command>list-timezones</command></term>
143
144 <listitem><para>List available time zones, one per line.
145 Entries from the list can be set as the system timezone with
146 <command>set-timezone</command>.</para></listitem>
147 </varlistentry>
148
149 <varlistentry>
150 <term><command>set-local-rtc [BOOL]</command></term>
151
152 <listitem><para>Takes a boolean argument. If
153 <literal>0</literal>, the system is configured to maintain the
154 RTC in universal time. If <literal>1</literal>, it will
155 maintain the RTC in local time instead. Note that maintaining
156 the RTC in the local timezone is not fully supported and will
157 create various problems with time zone changes and daylight
158 saving adjustments. If at all possible, keep the RTC in UTC
159 mode. Note that invoking this will also synchronize the RTC
160 from the system clock, unless
161 <option>--adjust-system-clock</option> is passed (see above).
162 This command will change the 3rd line of
163 <filename>/etc/adjtime</filename>, as documented in
164 <citerefentry project='man-pages'><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
165 </para></listitem>
166 </varlistentry>
167
168 <varlistentry>
169 <term><command>set-ntp [BOOL]</command></term>
170
2fc4f5bd 171 <listitem><para>Takes a boolean argument. Controls whether
b90930c7 172 network time synchronization is enabled (if available). This
2fc4f5bd
LP
173 enables or disables the
174 <filename>systemd-timesyncd.service</filename> unit. Note that
b90930c7
LP
175 even if this command turns time synchronization off a
176 different system service might still synchronize the clock
177 with the network.</para></listitem>
798d3a52
ZJS
178 </varlistentry>
179
180 </variablelist>
181
182 </refsect1>
183
184 <refsect1>
185 <title>Exit status</title>
186
187 <para>On success, 0 is returned, a non-zero failure
188 code otherwise.</para>
189 </refsect1>
190
191 <xi:include href="less-variables.xml" />
192
193 <refsect1>
194 <title>Examples</title>
195 <para>Show current settings:
196 <programlisting>$ timedatectl
57506e7d
LP
197 Local time: Di 2015-04-07 16:26:56 CEST
198 Universal time: Di 2015-04-07 14:26:56 UTC
199 RTC time: Di 2015-04-07 14:26:56
200 Time zone: Europe/Berlin (CEST, +0200)
b90930c7 201 Network time on: yes
57506e7d
LP
202NTP synchronized: yes
203 RTC in local TZ: no</programlisting>
798d3a52 204 </para>
be1015dd 205
b90930c7 206 <para>Enable network time synchronization:
798d3a52 207 <programlisting>$ timedatectl set-ntp true
be1015dd
ZJS
208==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp ===
209Authentication is required to control whether network time synchronization shall be enabled.
210Authenticating as: user
211Password: ********
9fccdb0f 212==== AUTHENTICATION COMPLETE ===</programlisting>
be1015dd 213
57506e7d
LP
214 <programlisting>$ systemctl status systemd-timesyncd.service
215● systemd-timesyncd.service - Network Time Synchronization
681eb9cf 216 Loaded: loaded (&rootlibexecdir;/system/systemd-timesyncd.service; enabled)
57506e7d
LP
217 Active: active (running) since Mo 2015-03-30 14:20:38 CEST; 5s ago
218 Docs: man:systemd-timesyncd.service(8)
219 Main PID: 595 (systemd-timesyn)
220 Status: "Using Time Server 216.239.38.15:123 (time4.google.com)."
221 CGroup: /system.slice/systemd-timesyncd.service
681eb9cf 222 └─595 &rootlibexecdir;/systemd-timesyncd
9fccdb0f 223...</programlisting>
798d3a52
ZJS
224 </para>
225 </refsect1>
226
227 <refsect1>
228 <title>See Also</title>
229 <para>
230 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
231 <citerefentry project='man-pages'><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
232 <citerefentry project='man-pages'><refentrytitle>date</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
233 <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
234 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
235 <citerefentry><refentrytitle>systemd-timedated.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
ff5921ba 236 <citerefentry><refentrytitle>systemd-timesyncd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
798d3a52
ZJS
237 <citerefentry><refentrytitle>systemd-firstboot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
238 </para>
239 </refsect1>
6d0274f1
LP
240
241</refentry>