1SYSTEMD.TIME(7)                  systemd.time                  SYSTEMD.TIME(7)
2
3
4

NAME

6       systemd.time - Time and date specifications
7

DESCRIPTION

9       In systemd, timestamps, time spans, and calendar events are displayed
10       and may be specified in closely related syntaxes.
11

DISPLAYING TIME SPANS

13       Time spans refer to time durations. On display, systemd will present
14       time spans as a space-separated series of time values each suffixed by
15       a time unit.
16
17           2h 30min
18
19       All specified time values are meant to be added up. The above hence
20       refers to 150 minutes.
21

PARSING TIME SPANS

23       When parsing, systemd will accept the same time span syntax. Separating
24       spaces may be omitted. The following time units are understood:
25
26       ·   usec, us
27
28       ·   msec, ms
29
30       ·   seconds, second, sec, s
31
32       ·   minutes, minute, min, m
33
34       ·   hours, hour, hr, h
35
36       ·   days, day, d
37
38       ·   weeks, week, w
39
40       ·   months, month
41
42       ·   years, year, y
43
44       If no time unit is specified, generally seconds are assumed, but some
45       exceptions exist and are marked as such. In a few cases "ns", "nsec" is
46       accepted too, where the granularity of the time span allows for this.
47
48       Examples for valid time span specifications:
49
50           2 h
51           2hours
52           48hr
53           1y 12month
54           55s500ms
55           300ms20s 5day
56

DISPLAYING TIMESTAMPS

58       Timestamps refer to specific, unique points in time. On display,
59       systemd will format these in the local timezone as follows:
60
61           Fri 2012-11-23 23:02:15 CET
62
63       The weekday is printed according to the locale choice of the user.
64

PARSING TIMESTAMPS

66       When parsing systemd will accept a similar timestamp syntax, but
67       excluding any timezone specification (this limitation might be removed
68       eventually). The weekday specification is optional, but when the
69       weekday is specified it must either be in the abbreviated ("Wed") or
70       non-abbreviated ("Wednesday") English language form (case does not
71       matter), and is not subject to the locale choice of the user. Either
72       the date, or the time part may be omitted, in which case the current
73       date or 00:00:00, resp., is assumed. The seconds component of the time
74       may also be omitted, in which case ":00" is assumed. Year numbers may
75       be specified in full or may be abbreviated (omitting the century).
76
77       A timestamp is considered invalid if a weekday is specified and the
78       date does not actually match the specified day of the week.
79
80       When parsing, systemd will also accept a few special placeholders
81       instead of timestamps: "now" may be used to refer to the current time
82       (or of the invocation of the command that is currently executed).
83       "today", "yesterday", "tomorrow" refer to 00:00:00 of the current day,
84       the day before or the next day, respectively.
85
86       When parsing, systemd will also accept relative time specifications. A
87       time span (see above) that is prefixed with "+" is evaluated to the
88       current time plus the specified time span. Correspondingly, a time span
89       that is prefixed with "-" is evaluated to the current time minus the
90       specified time span. Instead of prefixing the time span with "+" or
91       "-", it may also be suffixed with a space and the word "left" or "ago".
92
93       Finally, a timespan prefixed with "@" is evaluated relative to the UNIX
94       time epoch 1st Jan, 1970, 00:00.
95
96       Examples for valid timestamps and their normalized form (assuming the
97       current time was 2012-11-23 18:15:22):
98
99           Fri 2012-11-23 11:12:13 → Fri 2012-11-23 11:12:13
100               2012-11-23 11:12:13 → Fri 2012-11-23 11:12:13
101                  2012-11-23 → Fri 2012-11-23 00:00:00
102                    12-11-23 → Fri 2012-11-23 00:00:00
103                    11:12:13 → Fri 2012-11-23 11:12:13
104                 11:12 → Fri 2012-11-23 11:12:00
105                   now → Fri 2012-11-23 18:15:22
106                 today → Fri 2012-11-23 00:00:00
107                   yesterday → Fri 2012-11-22 00:00:00
108                    tomorrow → Fri 2012-11-24 00:00:00
109                    +3h30min → Fri 2012-11-23 21:45:22
110                   -5s → Fri 2012-11-23 18:15:17
111                   11min ago → Fri 2012-11-23 18:04:22
112                 @1395716396 → Tue 2014-03-25 03:59:56
113
114       Note that timestamps printed by systemd will not be parsed correctly by
115       systemd, as the timezone specification is not accepted, and printing
116       timestamps is subject to locale settings for the weekday while parsing
117       only accepts English weekday names.
118
119       In some cases, systemd will display a relative timestamp (relative to
120       the current time, or the time of invocation of the command) instead or
121       in addition to an absolute timestamp as described above. A relative
122       timestamp is formatted as follows:
123
124       2 months 5 days ago
125
126       Note that any relative timestamp will also parse correctly where a
127       timestamp is expected. (see above)
128

CALENDAR EVENTS

130       Calendar events may be used to refer to one or more points in time in a
131       single expression. They form a superset of the absolute timestamps
132       explained above:
133
134           Thu,Fri 2012-*-1,5 11:12:13
135
136       The above refers to 11:12:13 of the first or fifth day of any month of
137       the year 2012, but only if that day is a Thursday or Friday.
138
139       The weekday specification is optional. If specified, it should consist
140       of one or more English language weekday names, either in the
141       abbreviated (Wed) or non-abbreviated (Wednesday) form (case does not
142       matter), separated by commas. Specifying two weekdays separated by "-"
143       refers to a range of continuous weekdays.  "," and "-" may be combined
144       freely.
145
146       In the date and time specifications, any component may be specified as
147       "*" in which case any value will match. Alternatively, each component
148       can be specified as a list of values separated by commas. Values may
149       also be suffixed with "/" and a repetition value, which indicates that
150       the value and all values plus multiples of the repetition value are
151       matched.
152
153       Either time or date specification may be omitted, in which case the
154       current day and 00:00:00 is implied, respectively. If the second
155       component is not specified, ":00" is assumed.
156
157       Timezone names may not be specified.
158
159       The special expressions "minutely", "hourly", "daily", "monthly",
160       "weekly", "yearly", "quarterly", "semiannually" may be used as calendar
161       events which refer to "*-*-* *:*:00", "*-*-* *:00:00",
162       "*-*-* 00:00:00", "*-*-01 00:00:00", "Mon *-*-* 00:00:00",
163       "*-01-01 00:00:00", "*-01,04,07,10-01 00:00:0" and "*-01,07-01
164       00:00:00" respectively.
165
166       Examples for valid timestamps and their normalized form:
167
168              Sat,Thu,Mon-Wed,Sat-Sun → Mon-Thu,Sat,Sun *-*-* 00:00:00
169                Mon,Sun 12-*-* 2,1:23 → Mon,Sun 2012-*-* 01,02:23:00
170                  Wed *-1 → Wed *-*-01 00:00:00
171                Wed-Wed,Wed *-1 → Wed *-*-01 00:00:00
172               Wed, 17:48 → Wed *-*-* 17:48:00
173           Wed-Sat,Tue 12-10-15 1:2:3 → Tue-Sat 2012-10-15 01:02:03
174                    *-*-7 0:0:0 → *-*-07 00:00:00
175                    10-15 → *-10-15 00:00:00
176                  monday *-12-* 17:00 → Mon *-12-* 17:00:00
177            Mon,Fri *-*-3,1,2 *:30:45 → Mon,Fri *-*-01,02,03 *:30:45
178                 12,14,13,12:20,10,30 → *-*-* 12,13,14:10,20,30:00
179            mon,fri *-1/2-1,3 *:30:45 → Mon,Fri *-01/2-01,03 *:30:45
180                 03-05 08:05:40 → *-03-05 08:05:40
181                 08:05:40 → *-*-* 08:05:40
182                    05:40 → *-*-* 05:40:00
183               Sat,Sun 12-05 08:05:40 → Sat,Sun *-12-05 08:05:40
184               Sat,Sun 08:05:40 → Sat,Sun *-*-* 08:05:40
185               2003-03-05 05:40 → 2003-03-05 05:40:00
186               2003-03-05 → 2003-03-05 00:00:00
187                    03-05 → *-03-05 00:00:00
188                   hourly → *-*-* *:00:00
189                    daily → *-*-* 00:00:00
190                  monthly → *-*-01 00:00:00
191                   weekly → Mon *-*-* 00:00:00
192                   yearly → *-01-01 00:00:00
193                 annually → *-01-01 00:00:00
194                    *:2/3 → *-*-* *:02/3:00
195
196       Calendar events are used by timer units, see systemd.timer(5) for
197       details.
198

SEE ALSO

200       systemd(1), journalctl(1), systemd.timer(5), systemd.unit(5),
201       systemd.directives(7)
202
203
204
205systemd 219                                                    SYSTEMD.TIME(7)
Impressum