]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/org.freedesktop.timedate1.xml
man: run dbus api docs through the updater
[thirdparty/systemd.git] / man / org.freedesktop.timedate1.xml
CommitLineData
9c970e5f
ZJS
1<?xml version='1.0'?>
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" >
4<!-- SPDX-License-Identifier: LGPL-2.1+ -->
5
6<refentry id="org.freedesktop.timedate1" conditional='ENABLE_TIMEDATED'
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8 <refentryinfo>
9 <title>org.freedesktop.timedate1</title>
10 <productname>systemd</productname>
11 </refentryinfo>
12
13 <refmeta>
14 <refentrytitle>org.freedesktop.timedate1</refentrytitle>
15 <manvolnum>5</manvolnum>
16 </refmeta>
17
18 <refnamediv>
19 <refname>org.freedesktop.timedate1</refname>
20 <refpurpose>The D-Bus interface of systemd-timedated</refpurpose>
21 </refnamediv>
22
23 <refsect1>
24 <title>Introduction</title>
25
26 <para>
27 <citerefentry><refentrytitle>systemd-timedated.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
28 is a system service that can be used to control the system time and related settings. This page
29 describes the D-Bus interface.</para>
30 </refsect1>
31
32 <refsect1>
33 <title>The D-Bus API</title>
34
35 <para>The service exposes the following interfaces on the bus:</para>
36
37 <programlisting>
38$ gdbus introspect --system \
39 --dest org.freedesktop.timedate1 \
40 --object-path /org/freedesktop/timedate1
41
42node /org/freedesktop/timedate1 {
43 interface org.freedesktop.timedate1 {
44 methods:
45 SetTime(in x usec_utc,
46 in b relative,
4fb222c4 47 in b interactive);
9c970e5f 48 SetTimezone(in s timezone,
4fb222c4 49 in b interactive);
9c970e5f
ZJS
50 SetLocalRTC(in b local_rtc,
51 in b fix_system,
4fb222c4 52 in b interactive);
9c970e5f 53 SetNTP(in b use_ntp,
4fb222c4
ZJS
54 in b interactive);
55 ListTimezones(out as timezones);
9c970e5f 56 properties:
4fb222c4
ZJS
57 readonly s Timezone = '...';
58 readonly b LocalRTC = ...;
59 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
60 readonly b CanNTP = ...;
61 readonly b NTP = ...;
62 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
63 readonly b NTPSynchronized = ...;
64 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
65 readonly t TimeUSec = ...;
66 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
67 readonly t RTCTimeUSec = ...;
9c970e5f 68 };
4fb222c4
ZJS
69 interface org.freedesktop.DBus.Peer { ... };
70 interface org.freedesktop.DBus.Introspectable { ... };
71 interface org.freedesktop.DBus.Properties { ... };
9c970e5f
ZJS
72};
73 </programlisting>
74
4fb222c4
ZJS
75 <!--method ListTimezones is not documented!-->
76
77 <!--property Timezone is not documented!-->
78
79 <!--property LocalRTC is not documented!-->
80
81 <!--property CanNTP is not documented!-->
82
83 <!--property NTP is not documented!-->
84
85 <!--property NTPSynchronized is not documented!-->
86
87 <!--property TimeUSec is not documented!-->
88
89 <!--property RTCTimeUSec is not documented!-->
90
9c970e5f
ZJS
91 <refsect2>
92 <title>Methods</title>
93
94 <para>Use <function>SetTime()</function> to change the system clock. Pass a value of microseconds since
95 the UNIX epoch (1 Jan 1970 UTC). If <varname>relative</varname> is true, the passed usec value will be
96 added to the current system time, if it is false the current system time will be set to the passed usec
97 value. If the system time is set with this call the RTC will be updated as well.</para>
98
99 <para>Use <function>SetTimezone()</function> to set the system timezone. Pass a value like
100 <literal>Europe/Berlin</literal> to set the timezone. Valid timezones are listed in
101 <filename>/usr/share/zoneinfo/zone.tab</filename>. If the RTC is configured to be maintained in local
102 time, it will be updated accordingly.</para>
103
104 <para>Use <function>SetLocalRTC()</function> to control whether the RTC is in local time or UTC. It is
105 strongly recommended to maintain the RTC in UTC. Some OSes (Windows) however maintain the RTC in local
106 time, which might make it necessary to enable this feature. However, this creates various problems as
107 daylight changes might be missed. If <varname>fix_system</varname> is passed <literal>true</literal>,
108 the time from the RTC is read again and the system clock adjusted according to the new setting. If
109 <varname>fix_system</varname> is passed <literal>false</literal> the system time is written to the RTC
110 taking the new setting into account. Use <varname>fix_system=true</varname> in installers and livecds
111 where the RTC is probably more reliable than the system time. Use <varname>fix_system=false</varname>
112 in configuration UIs that are run during normal operation and where the system clock is probably more
113 reliable than the RTC.</para>
114
115 <para>Use <function>SetNTP()</function> to control whether the system clock is synchronized with the
116 network using <filename>systemd-timesyncd</filename>. This will enable and start or disable and stop
117 the chosen time synchronization service.</para>
118
119 <para>Whenever the timezone and local_rtc settings are changed via the daemon
120 <function>PropertyChanged</function> signals are sent out to which clients can subscribe. Changing the
121 time settings using this interface is authenticated via PolicyKit.</para>
122
123 <para>Note that this service will not inform you about system time changes. Use
4fb222c4 124 <citerefentry project="man-pages"><refentrytitle>timerfd</refentrytitle><manvolnum>3</manvolnum></citerefentry>
9c970e5f
ZJS
125 with <constant>CLOCK_REALTIME</constant> and <constant>TFD_TIMER_CANCEL_ON_SET</constant> for that.
126 </para>
127
128 <para>The <varname>user_interaction</varname> boolean parameters can be used to control whether
129 PolicyKit should interactively ask the user for authentication credentials if it needs to.</para>
130
131 <para>The PolicyKit action for <function>SetTimezone()</function> is
132 <interfacename>org.freedesktop.timedate1.set-timezone</interfacename>. For
133 <function>SetLocalRTC()</function> it is
134 <interfacename>org.freedesktop.timedate1.set-local-rtc</interfacename>, for
135 <function>SetTime()</function> it is <interfacename>org.freedesktop.timedate1.set-time</interfacename>
136 and for <function>SetNTP()</function> it is
137 <interfacename>org.freedesktop.timedate1.set-ntp</interfacename>.</para>
138 </refsect2>
139 </refsect1>
140
141 <refsect1>
142 <title>Versioning</title>
143
144 <para>These D-Bus interfaces follow <ulink url="http://0pointer.de/blog/projects/versioning-dbus.html">
145 the usual interface versioning guidelines</ulink>.</para>
146 </refsect1>
147
148 <refsect1>
149 <title>See also</title>
150
151 <para><ulink url="https://lists.freedesktop.org/archives/systemd-devel/2011-May/002526.html">More information on how the system clock and RTC interact</ulink></para>
152 </refsect1>
153</refentry>