]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - man/systemd.time.xml
man: s/dash/mdash/
[thirdparty/systemd.git] / man / systemd.time.xml
index 6cb32f13b7c3ad3f7bdd15f9d2a4eea6fa9453fc..a759707fec6670b1028c8b72ca7bad61e4eca8e7 100644 (file)
@@ -1,42 +1,13 @@
 <?xml version='1.0'?> <!--*-nxml-*-->
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
-
-<!--
-  SPDX-License-Identifier: LGPL-2.1+
-
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
--->
+<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
 
 <refentry id="systemd.time">
 
   <refentryinfo>
     <title>systemd.time</title>
     <productname>systemd</productname>
-
-    <authorgroup>
-      <author>
-        <contrib>Developer</contrib>
-        <firstname>Lennart</firstname>
-        <surname>Poettering</surname>
-        <email>lennart@poettering.net</email>
-      </author>
-    </authorgroup>
   </refentryinfo>
 
   <refmeta>
@@ -76,7 +47,7 @@
     understood:</para>
 
     <itemizedlist>
-      <listitem><para>usec, us</para></listitem>
+      <listitem><para>usec, us, µs</para></listitem>
       <listitem><para>msec, ms</para></listitem>
       <listitem><para>seconds, second, sec, s</para></listitem>
       <listitem><para>minutes, minute, min, m</para></listitem>
 1y 12month
 55s500ms
 300ms20s 5day</programlisting>
+
+    <para>One can use the <command>timespan</command> command of
+    <citerefentry><refentrytitle>systemd-analyze</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+    to normalise a textual time span for testing and validation purposes.</para>
+
+    <para>Internally, systemd generally operates with microsecond time granularity, while the default time
+    unit in user-configurable time spans is usually seconds (see above). This disparity becomes visible when
+    comparing the same settings in the (high-level) unit file syntax with the matching (more low-level) D-Bus
+    properties (which are what
+    <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
+    <command>show</command> command displays). The former typically are suffixed with <literal>…Sec</literal>
+    to indicate the default unit of seconds, the latter are typically suffixed with <literal>…USec</literal>
+    to indicate the underlying low-level time unit, even if they both encapsulate the very same
+    settings.</para>
   </refsect1>
 
   <refsect1>
   <refsect1>
     <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, 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,
-    respectively, 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).</para>
+    <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, 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 (e.g. with local timezone
+    it's possible to specify daylight saving time in winter, even though that is not correct). 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, respectively, 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).</para>
 
     <para>A timestamp is considered invalid if a weekday is specified and the date does not match the specified day of
     the week.</para>
     evaluated relative to the UNIX time epoch 1st Jan, 1970,
     00:00.</para>
 
-    <para>Examples for valid timestamps and their normalized form
-    (assuming the current time was 2012-11-23 18:15:22 and the timezone
-    was UTC+8, for example TZ=Asia/Shanghai):</para>
+    <para>Examples for valid timestamps and their normalized form (assuming the current time was 2012-11-23
+    18:15:22 and the timezone was UTC+8, for example <literal>TZ=:Asia/Shanghai</literal>):</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
@@ -198,6 +184,10 @@ tomorrow Pacific/Auckland → Thu 2012-11-23 19:00:00
     <programlisting>2 months 5 days ago</programlisting>
 
     <para>Note that a relative timestamp is also accepted where a timestamp is expected (see above).</para>
+
+    <para>Use the <command>timestamp</command> command of
+    <citerefentry><refentrytitle>systemd-analyze</refentrytitle><manvolnum>1</manvolnum></citerefentry> to
+    validate and normalize timestamps for testing purposes.</para>
   </refsect1>
 
   <refsect1>
@@ -221,15 +211,14 @@ tomorrow Pacific/Auckland → Thu 2012-11-23 19:00:00
     continuous weekdays. <literal>,</literal> and <literal>..</literal>
     may be combined freely.</para>
 
-    <para>In the date and time specifications, any component may be
-    specified as <literal>*</literal> in which case any value will
-    match. Alternatively, each component can be specified as a list of
-    values separated by commas. Values may be suffixed with
-    <literal>/</literal> and a repetition value, which indicates that
-    the value itself and the value plus all multiples of the repetition value
-    are matched.  Two values separated by <literal>..</literal> may be used
-    to indicate a range of values; ranges may also be followed with
-    <literal>/</literal> and a repetition value.</para>
+    <para>In the date and time specifications, any component may be specified as <literal>*</literal> in
+    which case any value will match. Alternatively, each component can be specified as a list of values
+    separated by commas. Values may be suffixed with <literal>/</literal> and a repetition value, which
+    indicates that the value itself and the value plus all multiples of the repetition value are matched.
+    Two values separated by <literal>..</literal> may be used to indicate a range of values; ranges may also
+    be followed with <literal>/</literal> and a repetition value, in which case the expression matches all
+    times starting with the start value, and continuing with all multiples of the repetition value relative
+    to the start value, ending at the end value the latest.</para>
 
     <para>A date specification may use <literal>~</literal> to indicate the
     last day(s) in a month. For example, <literal>*-02~03</literal> means
@@ -305,7 +294,7 @@ Wed..Sat,Tue 12-10-15 1:2:3 → Tue..Sat 2012-10-15 01:02:03
       <para>Use the <command>calendar</command> command of
       <citerefentry><refentrytitle>systemd-analyze</refentrytitle><manvolnum>1</manvolnum></citerefentry> to validate
       and normalize calendar time specifications for testing purposes. The tool also calculates when a specified
-      calendar event would elapse next.</para>
+      calendar event would occur next.</para>
   </refsect1>
 
   <refsect1>