1ORG.FREEDESKTOP.TIMEDATE1(5)org.freedesktop.timedateO1RG.FREEDESKTOP.TIMEDATE1(5)
2
3
4

NAME

6       org.freedesktop.timedate1 - The D-Bus interface of systemd-timedated
7

INTRODUCTION

9       systemd-timedated.service(8) is a system service that can be used to
10       control the system time and related settings. This page describes the
11       D-Bus interface.
12

THE D-BUS API

14       The service exposes the following interfaces on the bus:
15
16           node /org/freedesktop/timedate1 {
17             interface org.freedesktop.timedate1 {
18               methods:
19                 SetTime(in  x usec_utc,
20                         in  b relative,
21                         in  b interactive);
22                 SetTimezone(in  s timezone,
23                             in  b interactive);
24                 SetLocalRTC(in  b local_rtc,
25                             in  b fix_system,
26                             in  b interactive);
27                 SetNTP(in  b use_ntp,
28                        in  b interactive);
29                 ListTimezones(out as timezones);
30               properties:
31                 readonly s Timezone = '...';
32                 readonly b LocalRTC = ...;
33                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
34                 readonly b CanNTP = ...;
35                 readonly b NTP = ...;
36                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
37                 readonly b NTPSynchronized = ...;
38                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
39                 readonly t TimeUSec = ...;
40                 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
41                 readonly t RTCTimeUSec = ...;
42             };
43             interface org.freedesktop.DBus.Peer { ... };
44             interface org.freedesktop.DBus.Introspectable { ... };
45             interface org.freedesktop.DBus.Properties { ... };
46           };
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62   Methods
63       Use SetTime() to change the system clock. Pass a value of microseconds
64       since the UNIX epoch (1 Jan 1970 UTC). If relative is true, the passed
65       usec value will be added to the current system time. If it is false,
66       the current system time will be set to the passed usec value. If the
67       system time is set with this method, the RTC will be updated as well.
68
69       Use SetTimezone() to set the system timezone. Pass a value like
70       "Europe/Berlin" to set the timezone. Valid timezones are listed in
71       /usr/share/zoneinfo/zone.tab. If the RTC is configured to be maintained
72       in local time, it will be updated accordingly.
73
74       Use SetLocalRTC() to control whether the RTC is in local time or UTC.
75       It is strongly recommended to maintain the RTC in UTC. However, some
76       OSes (Windows) maintain the RTC in local time, which might make it
77       necessary to enable this feature. Note that this might create various
78       problems as daylight changes could be missed. If fix_system is "true",
79       the time from the RTC is read again and the system clock is adjusted
80       according to the new setting. If fix_system is "false", the system time
81       is written to the RTC taking the new setting into account. Use
82       fix_system=true in installers and livecds where the RTC is probably
83       more reliable than the system time. Use fix_system=false in
84       configuration UIs that are run during normal operation and where the
85       system clock is probably more reliable than the RTC.
86
87       Use SetNTP() to control whether the system clock is synchronized with
88       the network using systemd-timesyncd. This will enable and start or
89       disable and stop the chosen time synchronization service.
90
91       ListTimezones() returns a list of time zones known on the local system
92       as an array of names ("["Africa/Abidjan", "Africa/Accra", ...,
93       "UTC"]").
94
95   Properties
96       Timezone shows the currently configured time zone.  LocalRTC shows
97       whether the RTC is configured to use UTC (false), or the local time
98       zone (true).  CanNTP shows whether a service to perform time
99       synchronization over the network is available, and NTP shows whether
100       such a service is enabled.
101
102       NTPSynchronized shows whether the kernel reports the time as
103       synchronized (c.f.  adjtimex(3)).  TimeUSec and RTCTimeUSec show the
104       current time on the system and in the RTC. The purpose of those three
105       properties is to allow remote clients to access this information over
106       D-Bus. Local clients can access the information directly.
107
108       Whenever the Timezone and LocalRTC settings are changed via the daemon,
109       PropertyChanged signals are sent out to which clients can subscribe.
110
111       Note that this service will not inform you about system time changes.
112       Use timerfd(3) with CLOCK_REALTIME and TFD_TIMER_CANCEL_ON_SET for
113       that.
114
115   Security
116       The interactive boolean parameters can be used to control whether
117       polkit[1] should interactively ask the user for authentication
118       credentials if required.
119
120       The polkit action for SetTimezone() is
121       org.freedesktop.timedate1.set-timezone. For SetLocalRTC() it is
122       org.freedesktop.timedate1.set-local-rtc, for SetTime() it is
123       org.freedesktop.timedate1.set-time and for SetNTP() it is
124       org.freedesktop.timedate1.set-ntp.  ListTimezones() does not require
125       any privileges.
126

EXAMPLES

128       Example 1. Introspect org.freedesktop.timedate1 on the bus
129
130           $ gdbus introspect --system \
131             --dest org.freedesktop.timedate1 \
132             --object-path /org/freedesktop/timedate1
133
134

VERSIONING

136       These D-Bus interfaces follow the usual interface versioning
137       guidelines[2].
138

SEE ALSO

140       More information on how the system clock and RTC interact[3]
141

NOTES

143        1. polkit
144           https://www.freedesktop.org/software/polkit/docs/latest/
145
146        2. the usual interface versioning guidelines
147           https://0pointer.de/blog/projects/versioning-dbus.html
148
149        3. More information on how the system clock and RTC interact
150           https://lists.freedesktop.org/archives/systemd-devel/2011-May/002526.html
151
152
153
154systemd 254                                       ORG.FREEDESKTOP.TIMEDATE1(5)
Impressum