]> git.proxmox.com Git - systemd.git/blob - man/timedatectl.html
Imported Upstream version 208
[systemd.git] / man / timedatectl.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>timedatectl</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
2 a.headerlink {
3 color: #c60f0f;
4 font-size: 0.8em;
5 padding: 0 4px 0 4px;
6 text-decoration: none;
7 visibility: hidden;
8 }
9
10 a.headerlink:hover {
11 background-color: #c60f0f;
12 color: white;
13 }
14
15 h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
16 visibility: visible;
17 }
18 </style><a href="index.html">Index </a>·
19 <a href="systemd.directives.html">Directives </a>·
20 <a href="../python-systemd/index.html">Python </a>·
21 <a href="../libudev/index.html">libudev </a>·
22 <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 208</span><hr><div class="refentry"><a name="timedatectl"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>timedatectl — Control the system time and date</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">timedatectl [OPTIONS...] {COMMAND}</code> </p></div></div><div class="refsect1"><a name="idm274703814688"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p><span class="command"><strong>timedatectl</strong></span> may be used to
23 query and change the system clock and its
24 settings.</p></div><div class="refsect1"><a name="idm274703812832"></a><h2 id="Options">Options<a class="headerlink" title="Permalink to this headline" href="#Options"></a></h2><p>The following options are understood:</p><div class="variablelist"><dl class="variablelist"><dt id="-h"><span class="term"><code class="option">-h</code>, </span><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#-h"></a></dt><dd><p>Prints a short help
25 text and exits.</p></dd><dt id="--version"><span class="term"><code class="option">--version</code></span><a class="headerlink" title="Permalink to this term" href="#--version"></a></dt><dd><p>Prints a short version
26 string and exits.</p></dd><dt id="--no-pager"><span class="term"><code class="option">--no-pager</code></span><a class="headerlink" title="Permalink to this term" href="#--no-pager"></a></dt><dd><p>Do not pipe output into a
27 pager.</p></dd><dt id="--no-ask-password"><span class="term"><code class="option">--no-ask-password</code></span><a class="headerlink" title="Permalink to this term" href="#--no-ask-password"></a></dt><dd><p>Do not query the user
28 for authentication for privileged
29 operations.</p></dd><dt id="-P"><span class="term"><code class="option">-P</code>, </span><span class="term"><code class="option">--privileged</code></span><a class="headerlink" title="Permalink to this term" href="#-P"></a></dt><dd><p>Acquire privileges via PolicyKit
30 before executing the operation.</p></dd><dt id="-H"><span class="term"><code class="option">-H</code>, </span><span class="term"><code class="option">--host</code></span><a class="headerlink" title="Permalink to this term" href="#-H"></a></dt><dd><p>Execute the operation
31 remotely. Specify a hostname, or
32 username and hostname separated by "<code class="literal">@</code>",
33 to connect to. This will use SSH to
34 talk to a remote
35 system.</p></dd><dt id="--adjust-system-clock"><span class="term"><code class="option">--adjust-system-clock</code></span><a class="headerlink" title="Permalink to this term" href="#--adjust-system-clock"></a></dt><dd><p>If
36 <span class="command"><strong>set-local-rtc</strong></span> is
37 invoked and this option is passed, the
38 system clock is synchronized from the
39 RTC again, taking the new setting into
40 account. Otherwise, the RTC is
41 synchronized from the system
42 clock.</p></dd></dl></div><p>The following commands are understood:</p><div class="variablelist"><dl class="variablelist"><dt id="status"><span class="term"><span class="command"><strong>status</strong></span></span><a class="headerlink" title="Permalink to this term" href="#status"></a></dt><dd><p>Show current settings
43 of the system clock and
44 RTC.</p></dd><dt id="set-time [TIME]"><span class="term"><span class="command"><strong>set-time [TIME]</strong></span></span><a class="headerlink" title="Permalink to this term" href="#set-time%20%5BTIME%5D"></a></dt><dd><p>Set the system clock
45 to the specified time. This will also
46 update the RTC time accordingly. The time
47 may be specified in the format
48 "2012-10-30
49 18:17:16".</p></dd><dt id="set-timezone [TIMEZONE]"><span class="term"><span class="command"><strong>set-timezone [TIMEZONE]</strong></span></span><a class="headerlink" title="Permalink to this term" href="#set-timezone%20%5BTIMEZONE%5D"></a></dt><dd><p>Set the system time
50 zone to the specified value. Available
51 timezones can be listed with
52 <span class="command"><strong>list-timezones</strong></span>. If
53 the RTC is configured to be in the
54 local time, this will also update the
55 RTC time. This call will alter the
56 <code class="filename">/etc/localtime</code>
57 symlink. See
58 <a href="localtime.html"><span class="citerefentry"><span class="refentrytitle">localtime</span>(5)</span></a>
59 for more
60 information.</p></dd><dt id="list-timezones"><span class="term"><span class="command"><strong>list-timezones</strong></span></span><a class="headerlink" title="Permalink to this term" href="#list-timezones"></a></dt><dd><p>List available time
61 zones, one per line. Entries from the
62 list can be set as the system
63 timezone with
64 <span class="command"><strong>set-timezone</strong></span>.</p></dd><dt id="set-local-rtc [BOOL]"><span class="term"><span class="command"><strong>set-local-rtc [BOOL]</strong></span></span><a class="headerlink" title="Permalink to this term" href="#set-local-rtc%20%5BBOOL%5D"></a></dt><dd><p>Takes a boolean
65 argument. If "<code class="literal">0</code>", the
66 system is configured to maintain the
67 RTC in universal time. If
68 "<code class="literal">1</code>", it will maintain
69 the RTC in local time instead. Note
70 that maintaining the RTC in the local
71 timezone is not fully supported and
72 will create various problems with time
73 zone changes and daylight saving
74 adjustments. If at all possible, keep the
75 RTC in UTC mode. Note that invoking this
76 will also synchronize the RTC from the
77 system clock, unless
78 <code class="option">--adjust-system-clock</code> is
79 passed (see above). This command will
80 change the 3rd line of
81 <code class="filename">/etc/adjtime</code>, as
82 documented in
83 <a href="hwclock.html"><span class="citerefentry"><span class="refentrytitle">hwclock</span>(8)</span></a>.</p></dd><dt id="set-ntp [BOOL]"><span class="term"><span class="command"><strong>set-ntp [BOOL]</strong></span></span><a class="headerlink" title="Permalink to this term" href="#set-ntp%20%5BBOOL%5D"></a></dt><dd><p>Takes a boolean
84 argument. Controls whether NTP based
85 network time synchronization is
86 enabled (if
87 available).</p></dd></dl></div></div><div class="refsect1"><a name="idm274707674464"></a><h2 id="Exit status">Exit status<a class="headerlink" title="Permalink to this headline" href="#Exit%20status"></a></h2><p>On success 0 is returned, a non-zero failure
88 code otherwise.</p></div><div class="refsect1"><a name="idm274707673280"></a><h2 id="Environment">Environment<a class="headerlink" title="Permalink to this headline" href="#Environment"></a></h2><div class="variablelist"><dl class="variablelist"><dt id="$SYSTEMD_PAGER"><span class="term"><code class="varname">$SYSTEMD_PAGER</code></span><a class="headerlink" title="Permalink to this term" href="#%24SYSTEMD_PAGER"></a></dt><dd><p>Pager to use when
89 <code class="option">--no-pager</code> is not given;
90 overrides <code class="varname">$PAGER</code>. Setting
91 this to an empty string or the value
92 "<code class="literal">cat</code>" is equivalent to passing
93 <code class="option">--no-pager</code>.</p></dd></dl></div></div><div class="refsect1"><a name="idm274707668304"></a><h2 id="Examples">Examples<a class="headerlink" title="Permalink to this headline" href="#Examples"></a></h2><p>Show current settings:
94 </p><pre class="programlisting">
95 $ timedatectl
96 Local time: Fri, 2012-11-02 09:26:46 CET
97 Universal time: Fri, 2012-11-02 08:26:46 UTC
98 RTC time: Fri, 2012-11-02 08:26:45
99 Timezone: Europe/Warsaw
100 UTC offset: +0100
101 NTP enabled: no
102 NTP synchronized: no
103 RTC in local TZ: no
104 DST active: no
105 Last DST change: CEST → CET, DST became inactive
106 Sun, 2012-10-28 02:59:59 CEST
107 Sun, 2012-10-28 02:00:00 CET
108 Next DST change: CET → CEST, DST will become active
109 the clock will jump one hour forward
110 Sun, 2013-03-31 01:59:59 CET
111 Sun, 2013-03-31 03:00:00 CEST
112 </pre><p>
113 </p><p>Enable an NTP daemon (chronyd):
114 </p><pre class="programlisting">
115 $ timedatectl set-ntp true
116 ==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp ===
117 Authentication is required to control whether network time synchronization shall be enabled.
118 Authenticating as: user
119 Password: ********
120 ==== AUTHENTICATION COMPLETE ===
121 </pre><p>
122
123 </p><pre class="programlisting">
124 $ systemctl status chronyd.service
125 chronyd.service - NTP client/server
126 Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled)
127 Active: active (running) since Fri, 2012-11-02 09:36:25 CET; 5s ago
128 ...
129 </pre><p>
130 </p></div><div class="refsect1"><a name="idm274707662928"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
131 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
132 <a href="hwclock.html"><span class="citerefentry"><span class="refentrytitle">hwclock</span>(8)</span></a>,
133 <a href="date.html"><span class="citerefentry"><span class="refentrytitle">date</span>(1)</span></a>,
134 <a href="localtime.html"><span class="citerefentry"><span class="refentrytitle">localtime</span>(5)</span></a>,
135 <a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>,
136 <a href="systemd-timedated.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-timedated.service</span>(8)</span></a>
137 </p></div></div></body></html>