mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
parent
ffa69a04be
commit
54d3be9772
@ -122,8 +122,12 @@
|
||||
<title>Parsing Timestamps</title>
|
||||
|
||||
<para>When parsing, systemd will accept a similar syntax, but expects no timezone specification, unless it is given
|
||||
as the literal string <literal>UTC</literal> (for the UTC timezone) or is specified to be the locally configured
|
||||
timezone. Other timezones than the local and UTC are not supported. The weekday specification is optional, but when
|
||||
as the literal string <literal>UTC</literal> (for the UTC timezone), or is specified to be the locally configured
|
||||
timezone, or the timezone name in the IANA timezone database format. The complete list of timezones
|
||||
supported on your system can be obtained using the <literal>timedatectl list-timezones</literal>
|
||||
(see <citerefentry><refentrytitle>timedatectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>).
|
||||
Using IANA format is recommended over local timezone names, as less prone to errors (eg: with local timezone it's possible to
|
||||
specify daylight saving time in winter, while it's incorrect). 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. Either the date, or the time part may be omitted, in which case the current date or 00:00:00,
|
||||
@ -159,22 +163,23 @@
|
||||
(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 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 → 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
|
||||
-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>
|
||||
<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 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 → 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
|
||||
tomorrow Pacific/Auckland → Thu 2012-11-23 19: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>
|
||||
|
||||
<para>Note that timestamps displayed by remote systems with a non-matching timezone are usually not parsable
|
||||
locally, as the timezone component is not understood (unless it happens to be <literal>UTC</literal>).</para>
|
||||
@ -238,9 +243,9 @@
|
||||
second component is not specified, <literal>:00</literal> is
|
||||
assumed.</para>
|
||||
|
||||
<para>A timezone specification is not expected, unless it is given as the literal string <literal>UTC</literal>, or
|
||||
the local timezone, similar to the supported syntax of timestamps (see above). Non-local timezones except for UTC
|
||||
are not supported.</para>
|
||||
<para>Timezone can be specified as the literal string <literal>UTC</literal>, or
|
||||
the local timezone, similar to the supported syntax of timestamps (see above), or the timezone
|
||||
in the IANA timezone database format (also see above).</para>
|
||||
|
||||
<para>The following special expressions may be used as shorthands for longer normalized forms:</para>
|
||||
|
||||
@ -286,6 +291,7 @@ Wed..Sat,Tue 12-10-15 1:2:3 → Tue..Sat 2012-10-15 01:02:03
|
||||
daily UTC → *-*-* 00:00:00 UTC
|
||||
monthly → *-*-01 00:00:00
|
||||
weekly → Mon *-*-* 00:00:00
|
||||
weekly Pacific/Auckland → Mon *-*-* 00:00:00 Pacific/Auckland
|
||||
yearly → *-01-01 00:00:00
|
||||
annually → *-01-01 00:00:00
|
||||
*:2/3 → *-*-* *:02/3:00</programlisting>
|
||||
|
Loading…
Reference in New Issue
Block a user