man: mention UTC support for timestamps

This commit is contained in:
Hristo Venev 2015-10-15 02:57:58 +03:00
parent 063bc36469
commit d08a6b02b5
1 changed files with 25 additions and 17 deletions

View File

@ -117,10 +117,11 @@
<refsect1>
<title>Parsing Timestamps</title>
<para>When 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
<para>When parsing systemd will accept a similar syntax, but expects
no timezone specification, unless it is given as the literal string
"UTC". In this case the time is considered in UTC time, otherwise in
the local timezone. The weekday specification is optional, but when
the weekday is specified it must either be in the abbreviated
(<literal>Wed</literal>) or non-abbreviated
(<literal>Wednesday</literal>) English language form (case does
not matter), and is not subject to the locale choice of the user.
@ -157,22 +158,29 @@
00:00.</para>
<para>Examples for valid timestamps and their normalized form
(assuming the current time was 2012-11-23 18:15:22):</para>
(assuming the current time was 2012-11-23 18:15:22 and the timezone
was UTC+8, for example TZ=Asia/Shanghai):</para>
<programlisting>Fri 2012-11-23 11:12:13 → Fri 2012-11-23 11:12:13
2012-11-23 11:12:13 → Fri 2012-11-23 11:12:13
2012-11-23 → Fri 2012-11-23 00:00:00
12-11-23 → Fri 2012-11-23 00:00:00
11:12:13 → Fri 2012-11-23 11:12:13
11:12 → Fri 2012-11-23 11:12:00
now → Fri 2012-11-23 18:15:22
today → Fri 2012-11-23 00:00:00
yesterday → Fri 2012-11-22 00:00:00
tomorrow → Fri 2012-11-24 00:00:00
+3h30min → Fri 2012-11-23 21:45:22
-5s → Fri 2012-11-23 18:15:17
11min ago → Fri 2012-11-23 18:04:22
@1395716396 → Tue 2014-03-25 03:59:56</programlisting>
2012-11-23 11:12:13 UTC → Fri 2012-11-23 19:12:13
2012-11-23 → Fri 2012-11-23 00:00:00
12-11-23 → Fri 2012-11-23 00:00:00
11:12:13 → Fri 2012-11-23 11:12:13
11:12:13.9900009 → Fri 2012-11-23 11:12:13
format_timestamp_us: Fri 2012-11-23 11:12:13.990000
11:12 → Fri 2012-11-23 11:12:00
now → Fri 2012-11-23 18:15:22
today → Fri 2012-11-23 00:00:00
today UTC → Fri 2012-11-23 16:00:00
yesterday → Fri 2012-11-22 00:00:00
tomorrow → Fri 2012-11-24 00:00:00
+3h30min → Fri 2012-11-23 21:45:22
+3h30min UTC → -EINVAL
-5s → Fri 2012-11-23 18:15:17
11min ago → Fri 2012-11-23 18:04:22
11min ago UTC → -EINVAL
@1395716396 → Tue 2014-03-25 03:59:56</programlisting>
<para>Note that timestamps printed by systemd will not be parsed
correctly by systemd, as the timezone specification is not