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>
11
background-color: #c60f0f;
15
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
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 204</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="idm259798163584"></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="idm259798234656"></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>Don't query the user
28
for authentication for privileged
29
operations.</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
30
remotely. Specify a hostname, or
31
username and hostname separated by @,
32
to connect to. This will use SSH to
34
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
35
<span class="command"><strong>set-local-rtc</strong></span> is
36
invoked and this option is passed the
37
system clock is synchronized from the
38
RTC again, taking the new setting into
39
account. Otherwise the RTC is
40
synchronized from the system
41
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
42
of the system clock and
43
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
44
to the specified time. This will also
45
update the RTC time accordingly. The time
46
may be specified in the format
48
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
49
zone to the specified value. Available
50
time zones can be listed with
51
<span class="command"><strong>list-timezones</strong></span>. If
52
the RTC is configured to be in the
53
local time this will also update the
54
RTC time. This call will alter the
55
<code class="filename">/etc/localtime</code>
57
<a href="localtime.html"><span class="citerefentry"><span class="refentrytitle">localtime</span>(5)</span></a>
59
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
60
zones, one per line. Entries from the
61
list can be set as the system
63
<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
64
argument. If <code class="literal">0</code> the
65
system is configured to maintain the
66
RTC in universal time, if
67
<code class="literal">1</code> it will maintain
68
the RTC in local time instead. Note
69
that maintaining the RTC in the local
70
time zone is not fully supported and
71
will create various problems with time
72
zone changes and daylight saving
73
adjustments. If at all possible use
74
RTC in UTC. Note that invoking this
75
will also synchronize the RTC from the
77
<code class="option">--adjust-system-clock</code> is
78
passed (see above). This command will
79
change the 3rd line of
80
<code class="filename">/etc/adjtime</code>, as
82
<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
83
argument. Controls whether NTP based
84
network time synchronization is
86
available).</p></dd></dl></div></div><div class="refsect1"><a name="idm259798321808"></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
87
code otherwise.</p></div><div class="refsect1"><a name="idm259798320624"></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
88
<code class="option">--no-pager</code> is not given;
89
overrides <code class="varname">$PAGER</code>. Setting
90
this to an empty string or the value
91
<code class="literal">cat</code> is equivalent to passing
92
<code class="option">--no-pager</code>.</p></dd></dl></div></div><div class="refsect1"><a name="idm259798308656"></a><h2 id="Examples">Examples<a class="headerlink" title="Permalink to this headline" href="#Examples">¶</a></h2><p>Show current settings:
93
</p><pre class="programlisting">
95
Local time: Fri, 2012-11-02 09:26:46 CET
96
Universal time: Fri, 2012-11-02 08:26:46 UTC
97
RTC time: Fri, 2012-11-02 08:26:45
98
Timezone: Europe/Warsaw
104
Last DST change: CEST → CET, DST became inactive
105
Sun, 2012-10-28 02:59:59 CEST
106
Sun, 2012-10-28 02:00:00 CET
107
Next DST change: CET → CEST, DST will become active
108
the clock will jump one hour forward
109
Sun, 2013-03-31 01:59:59 CET
110
Sun, 2013-03-31 03:00:00 CEST
112
</p><p>Enable an NTP daemon (chronyd):
113
</p><pre class="programlisting">
114
$ timedatectl set-ntp true
115
==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp ===
116
Authentication is required to control whether network time synchronization shall be enabled.
117
Authenticating as: user
119
==== AUTHENTICATION COMPLETE ===
122
</p><pre class="programlisting">
123
$ systemctl status chronyd.service
124
chronyd.service - NTP client/server
125
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled)
126
Active: active (running) since Fri, 2012-11-02 09:36:25 CET; 5s ago
129
</p></div><div class="refsect1"><a name="idm259798303280"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
130
<a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
131
<a href="hwclock.html"><span class="citerefentry"><span class="refentrytitle">hwclock</span>(8)</span></a>,
132
<a href="date.html"><span class="citerefentry"><span class="refentrytitle">date</span>(1)</span></a>,
133
<a href="localtime.html"><span class="citerefentry"><span class="refentrytitle">localtime</span>(5)</span></a>,
134
<a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>,
135
<a href="systemd-timedated.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-timedated.service</span>(8)</span></a>
136
</p></div></div></body></html>