]> git.proxmox.com Git - systemd.git/blame - man/systemd.time.7
Imported Upstream version 220
[systemd.git] / man / systemd.time.7
CommitLineData
14228c0d 1'\" t
e3bff60a 2.TH "SYSTEMD\&.TIME" "7" "" "systemd 220" "systemd.time"
14228c0d
MB
3.\" -----------------------------------------------------------------
4.\" * Define some portability stuff
5.\" -----------------------------------------------------------------
6.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7.\" http://bugs.debian.org/507673
8.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10.ie \n(.g .ds Aq \(aq
11.el .ds Aq '
12.\" -----------------------------------------------------------------
13.\" * set default formatting
14.\" -----------------------------------------------------------------
15.\" disable hyphenation
16.nh
17.\" disable justification (adjust text to left margin only)
18.ad l
19.\" -----------------------------------------------------------------
20.\" * MAIN CONTENT STARTS HERE *
21.\" -----------------------------------------------------------------
22.SH "NAME"
23systemd.time \- Time and date specifications
24.SH "DESCRIPTION"
25.PP
26In systemd, timestamps, time spans, and calendar events are displayed and may be specified in closely related syntaxes\&.
27.SH "DISPLAYING TIME SPANS"
28.PP
29Time spans refer to time durations\&. On display, systemd will present time spans as a space\-separated series of time values each suffixed by a time unit\&.
30.sp
31.if n \{\
32.RS 4
33.\}
34.nf
352h 30min
36.fi
37.if n \{\
38.RE
39.\}
40.PP
41All specified time values are meant to be added up\&. The above hence refers to 150 minutes\&.
42.SH "PARSING TIME SPANS"
43.PP
44When parsing, systemd will accept the same time span syntax\&. Separating spaces may be omitted\&. The following time units are understood:
45.sp
46.RS 4
47.ie n \{\
48\h'-04'\(bu\h'+03'\c
49.\}
50.el \{\
51.sp -1
52.IP \(bu 2.3
53.\}
54usec, us
55.RE
56.sp
57.RS 4
58.ie n \{\
59\h'-04'\(bu\h'+03'\c
60.\}
61.el \{\
62.sp -1
63.IP \(bu 2.3
64.\}
65msec, ms
66.RE
67.sp
68.RS 4
69.ie n \{\
70\h'-04'\(bu\h'+03'\c
71.\}
72.el \{\
73.sp -1
74.IP \(bu 2.3
75.\}
76seconds, second, sec, s
77.RE
78.sp
79.RS 4
80.ie n \{\
81\h'-04'\(bu\h'+03'\c
82.\}
83.el \{\
84.sp -1
85.IP \(bu 2.3
86.\}
87minutes, minute, min, m
88.RE
89.sp
90.RS 4
91.ie n \{\
92\h'-04'\(bu\h'+03'\c
93.\}
94.el \{\
95.sp -1
96.IP \(bu 2.3
97.\}
98hours, hour, hr, h
99.RE
100.sp
101.RS 4
102.ie n \{\
103\h'-04'\(bu\h'+03'\c
104.\}
105.el \{\
106.sp -1
107.IP \(bu 2.3
108.\}
109days, day, d
110.RE
111.sp
112.RS 4
113.ie n \{\
114\h'-04'\(bu\h'+03'\c
115.\}
116.el \{\
117.sp -1
118.IP \(bu 2.3
119.\}
120weeks, week, w
121.RE
122.sp
123.RS 4
124.ie n \{\
125\h'-04'\(bu\h'+03'\c
126.\}
127.el \{\
128.sp -1
129.IP \(bu 2.3
130.\}
131months, month
132.RE
133.sp
134.RS 4
135.ie n \{\
136\h'-04'\(bu\h'+03'\c
137.\}
138.el \{\
139.sp -1
140.IP \(bu 2.3
141.\}
142years, year, y
143.RE
144.PP
145If no time unit is specified, generally seconds are assumed, but some exceptions exist and are marked as such\&. In a few cases
146"ns",
147"nsec"
148is accepted too, where the granularity of the time span allows for this\&.
149.PP
150Examples for valid time span specifications:
151.sp
152.if n \{\
153.RS 4
154.\}
155.nf
1562 h
1572hours
15848hr
1591y 12month
16055s500ms
161300ms20s 5day
162.fi
163.if n \{\
164.RE
165.\}
166.SH "DISPLAYING TIMESTAMPS"
167.PP
168Timestamps refer to specific, unique points in time\&. On display, systemd will format these in the local timezone as follows:
169.sp
170.if n \{\
171.RS 4
172.\}
173.nf
174Fri 2012\-11\-23 23:02:15 CET
175.fi
176.if n \{\
177.RE
178.\}
179.PP
180The weekday is printed according to the locale choice of the user\&.
181.SH "PARSING TIMESTAMPS"
182.PP
183When parsing systemd will accept a similar timestamp syntax, but excluding any timezone specification (this limitation might be removed eventually)\&. The weekday specification is optional, but when the weekday is specified it must either be in the abbreviated ("Wed") or non\-abbreviated ("Wednesday") English language form (case does not matter), and is not subject to the locale choice of the user\&. Either the date, or the time part may be omitted, in which case the current date or 00:00:00, resp\&., is assumed\&. The seconds component of the time may also be omitted, in which case ":00" is assumed\&. Year numbers may be specified in full or may be abbreviated (omitting the century)\&.
184.PP
185A timestamp is considered invalid if a weekday is specified and the date does not actually match the specified day of the week\&.
186.PP
187When parsing, systemd will also accept a few special placeholders instead of timestamps:
188"now"
189may be used to refer to the current time (or of the invocation of the command that is currently executed)\&.
190"today",
191"yesterday",
192"tomorrow"
193refer to 00:00:00 of the current day, the day before or the next day, respectively\&.
194.PP
195When parsing, systemd will also accept relative time specifications\&. A time span (see above) that is prefixed with
196"+"
197is evaluated to the current time plus the specified time span\&. Correspondingly, a time span that is prefixed with
198"\-"
199is evaluated to the current time minus the specified time span\&. Instead of prefixing the time span with
60f067b4
JS
200"+"
201or
14228c0d 202"\-", it may also be suffixed with a space and the word
60f067b4
JS
203"left"
204or
14228c0d
MB
205"ago"\&.
206.PP
60f067b4
JS
207Finally, a timespan prefixed with
208"@"
209is evaluated relative to the UNIX time epoch 1st Jan, 1970, 00:00\&.
210.PP
14228c0d
MB
211Examples for valid timestamps and their normalized form (assuming the current time was 2012\-11\-23 18:15:22):
212.sp
213.if n \{\
214.RS 4
215.\}
216.nf
217Fri 2012\-11\-23 11:12:13 → Fri 2012\-11\-23 11:12:13
218 2012\-11\-23 11:12:13 → Fri 2012\-11\-23 11:12:13
e735f4d4
MP
219 2012\-11\-23 → Fri 2012\-11\-23 00:00:00
220 12\-11\-23 → Fri 2012\-11\-23 00:00:00
221 11:12:13 → Fri 2012\-11\-23 11:12:13
222 11:12 → Fri 2012\-11\-23 11:12:00
223 now → Fri 2012\-11\-23 18:15:22
224 today → Fri 2012\-11\-23 00:00:00
225 yesterday → Fri 2012\-11\-22 00:00:00
226 tomorrow → Fri 2012\-11\-24 00:00:00
227 +3h30min → Fri 2012\-11\-23 21:45:22
228 \-5s → Fri 2012\-11\-23 18:15:17
229 11min ago → Fri 2012\-11\-23 18:04:22
230 @1395716396 → Tue 2014\-03\-25 03:59:56
14228c0d
MB
231.fi
232.if n \{\
233.RE
234.\}
235.PP
236Note that timestamps printed by systemd will not be parsed correctly by systemd, as the timezone specification is not accepted, and printing timestamps is subject to locale settings for the weekday while parsing only accepts English weekday names\&.
237.PP
238In some cases, systemd will display a relative timestamp (relative to the current time, or the time of invocation of the command) instead or in addition to an absolute timestamp as described above\&. A relative timestamp is formatted as follows:
239.PP
2402 months 5 days ago
241.PP
242Note that any relative timestamp will also parse correctly where a timestamp is expected\&. (see above)
243.SH "CALENDAR EVENTS"
244.PP
245Calendar events may be used to refer to one or more points in time in a single expression\&. They form a superset of the absolute timestamps explained above:
246.sp
247.if n \{\
248.RS 4
249.\}
250.nf
251Thu,Fri 2012\-*\-1,5 11:12:13
252.fi
253.if n \{\
254.RE
255.\}
256.PP
e735f4d4 257The above refers to 11:12:13 of the first or fifth day of any month of the year 2012, but only if that day is a Thursday or Friday\&.
14228c0d
MB
258.PP
259The weekday specification is optional\&. If specified, it should consist of one or more English language weekday names, either in the abbreviated (Wed) or non\-abbreviated (Wednesday) form (case does not matter), separated by commas\&. Specifying two weekdays separated by
260"\-"
261refers to a range of continuous weekdays\&.
262","
263and
264"\-"
265may be combined freely\&.
266.PP
267In the date and time specifications, any component may be specified as
268"*"
60f067b4 269in which case any value will match\&. Alternatively, each component can be specified as a list of values separated by commas\&. Values may also be suffixed with
14228c0d
MB
270"/"
271and a repetition value, which indicates that the value and all values plus multiples of the repetition value are matched\&.
272.PP
273Either time or date specification may be omitted, in which case the current day and 00:00:00 is implied, respectively\&. If the second component is not specified,
274":00"
275is assumed\&.
276.PP
277Timezone names may not be specified\&.
278.PP
279The special expressions
5eef597e 280"minutely",
14228c0d
MB
281"hourly",
282"daily",
5eef597e
MP
283"monthly",
284"weekly",
285"yearly",
286"quarterly",
287"semiannually"
14228c0d 288may be used as calendar events which refer to
5eef597e
MP
289"*\-*\-*\ \&*:*:00",
290"*\-*\-*\ \&*:00:00",
291"*\-*\-*\ \&00:00:00",
292"*\-*\-01\ \&00:00:00",
293"Mon\ \&*\-*\-*\ \&00:00:00",
294"*\-01\-01\ \&00:00:00",
295"*\-01,04,07,10\-01 00:00:0"
14228c0d 296and
5eef597e
MP
297"*\-01,07\-01 00:00:00"
298respectively\&.
14228c0d
MB
299.PP
300Examples for valid timestamps and their normalized form:
301.sp
302.if n \{\
303.RS 4
304.\}
305.nf
306 Sat,Thu,Mon\-Wed,Sat\-Sun → Mon\-Thu,Sat,Sun *\-*\-* 00:00:00
307 Mon,Sun 12\-*\-* 2,1:23 → Mon,Sun 2012\-*\-* 01,02:23:00
e735f4d4
MP
308 Wed *\-1 → Wed *\-*\-01 00:00:00
309 Wed\-Wed,Wed *\-1 → Wed *\-*\-01 00:00:00
310 Wed, 17:48 → Wed *\-*\-* 17:48:00
14228c0d 311Wed\-Sat,Tue 12\-10\-15 1:2:3 → Tue\-Sat 2012\-10\-15 01:02:03
e735f4d4
MP
312 *\-*\-7 0:0:0 → *\-*\-07 00:00:00
313 10\-15 → *\-10\-15 00:00:00
14228c0d
MB
314 monday *\-12\-* 17:00 → Mon *\-12\-* 17:00:00
315 Mon,Fri *\-*\-3,1,2 *:30:45 → Mon,Fri *\-*\-01,02,03 *:30:45
316 12,14,13,12:20,10,30 → *\-*\-* 12,13,14:10,20,30:00
317 mon,fri *\-1/2\-1,3 *:30:45 → Mon,Fri *\-01/2\-01,03 *:30:45
e735f4d4
MP
318 03\-05 08:05:40 → *\-03\-05 08:05:40
319 08:05:40 → *\-*\-* 08:05:40
320 05:40 → *\-*\-* 05:40:00
14228c0d 321 Sat,Sun 12\-05 08:05:40 → Sat,Sun *\-12\-05 08:05:40
e735f4d4
MP
322 Sat,Sun 08:05:40 → Sat,Sun *\-*\-* 08:05:40
323 2003\-03\-05 05:40 → 2003\-03\-05 05:40:00
324 2003\-03\-05 → 2003\-03\-05 00:00:00
325 03\-05 → *\-03\-05 00:00:00
326 hourly → *\-*\-* *:00:00
327 daily → *\-*\-* 00:00:00
328 monthly → *\-*\-01 00:00:00
329 weekly → Mon *\-*\-* 00:00:00
330 yearly → *\-01\-01 00:00:00
331 annually → *\-01\-01 00:00:00
332 *:2/3 → *\-*\-* *:02/3:00
14228c0d
MB
333.fi
334.if n \{\
335.RE
336.\}
337.PP
338Calendar events are used by timer units, see
339\fBsystemd.timer\fR(5)
340for details\&.
341.SH "SEE ALSO"
342.PP
343\fBsystemd\fR(1),
344\fBjournalctl\fR(1),
345\fBsystemd.timer\fR(5),
346\fBsystemd.unit\fR(5),
347\fBsystemd.directives\fR(7)