[system-administrators-guide] Update: Configuring the Date and Time

stephenw stephenw at fedoraproject.org
Tue Dec 9 17:26:15 UTC 2014


commit 8473b5e41539fee8874248b7cacbf0834ac30582
Author: Stephen Wadeley <swadeley at redhat.com>
Date:   Tue Dec 9 18:25:11 2014 +0100

    Update: Configuring the Date and Time

 en-US/Configuring_the_Date_and_Time.xml |  691 ++++++++++++++++++++-----------
 1 files changed, 450 insertions(+), 241 deletions(-)
---
diff --git a/en-US/Configuring_the_Date_and_Time.xml b/en-US/Configuring_the_Date_and_Time.xml
index fac900c..051ecb3 100644
--- a/en-US/Configuring_the_Date_and_Time.xml
+++ b/en-US/Configuring_the_Date_and_Time.xml
@@ -1,280 +1,489 @@
 <?xml version='1.0'?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-]>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
 <chapter id="ch-Configuring_the_Date_and_Time">
   <title>Configuring the Date and Time</title>
   <para>
-    This chapter covers setting the system date and time in &MAJOROS;, both manually and using the <firstterm>Network Time Protocol</firstterm> (<acronym>NTP</acronym>), as well as setting the time zone. Two methods are covered: setting the date and time using the <application>Date and Time</application> configuration tool, and doing so on the command line.
+    Modern operating systems distinguish between the following two types of clocks:
   </para>
-  <section id="sect-Configuring_the_Date_and_Time-Date_and_Time">
-    <title>Using the Date and Time Configuration Tool</title>
-    <para>
-      &MAJOROSVER; is shipped with the <application>Date and Time</application> configuration tool, which allows you to change the date and time of the system, to configure the time zone used by the system, and to set up the Network Time Protocol daemon to synchronize the system clock with a time server. To start the tool, either select <menuchoice><guimenu>Applications</guimenu><guisubmenu>System Tools</guisubmenu><guimenuitem>System Settings</guimenuitem></menuchoice> from the <guimenu>Activities</guimenu> menu and click the <guimenuitem>Date and Time</guimenuitem> icon, or click the time in the panel and select <guibutton>Date and Time Settings</guibutton> from the drop-down menu.
-    </para>
-    <figure id="fig-Configuring_the_Date_and_Time-Date_and_Time">
-      <title>The Date and Time configuration tool</title>
-      <mediaobject>
-        <imageobject>
-          <imagedata fileref="images/date-and-time-settings.png" format="PNG" scalefit="0" />
-        </imageobject>
-        <textobject>
-          <para>
-            The Date and Time configuration tool
-          </para>
-        </textobject>
-      </mediaobject>
-    </figure>
-    <para>
-      By default, the tool only allows you to review the current settings. This is because only <systemitem class="username">root</systemitem> is allowed to set the system date and time. To unlock the configuration tool for changes, click the <guibutton>Unlock</guibutton> button in the top-right corner of the window, and provide the correct password when prompted.
-    </para>
-    <indexterm>
-      <primary><application>Date and Time</application></primary>
-      <secondary>system time</secondary>
-    </indexterm>
-    <indexterm>
-      <primary>time</primary>
-      <seealso><application>Date and Time</application></seealso>
-    </indexterm>
+  <itemizedlist>
+    <listitem>
+      <para>
+        A <firstterm>real-time clock</firstterm> (<acronym>RTC</acronym>), commonly referred to as a <firstterm>hardware clock</firstterm>, (typically an integrated circuit on the system board) that is completely independent of the current state of the operating system and runs even when the computer is shut down.
+      </para>
+    </listitem>
+    <listitem>
+      <para>
+        A <firstterm>system clock</firstterm>, also known as a <firstterm>software clock</firstterm>, that is maintained by the kernel and its initial value is based on the real-time clock. Once the system is booted and the system clock is initialized, the system clock is completely independent of the real-time clock.
+      </para>
+    </listitem>
+  </itemizedlist>
+<para>
+  The system time is always kept in <firstterm>Coordinated Universal Time</firstterm> (<acronym>UTC</acronym>) and converted in applications to local time as needed. <firstterm>Local time</firstterm> is the actual time in your current time zone, taking into account <firstterm>daylight saving time</firstterm> (<acronym>DST</acronym>). The real-time clock can use either UTC or local time. UTC is recommended.
+  </para>
+  <para>
+    &MAJOROSVER; offers three command line tools that can be used to configure and display information about the system date and time: the <command>timedatectl</command> utility, which is new in &MAJOROSVER; and is part of <systemitem class="daemon">systemd</systemitem>; the traditional <command>date</command> command; and the <command>hwclock</command> utility for accessing the hardware clock.
+  </para>
+  <section id="sect-Configuring_the_Date_and_Time-timedatectl">
+    <title>Using the timedatectl Command</title>
     <para>
-      To change the current time of your system, either configure the system to synchronize it over the network by clicking the <guilabel>Network Time</guilabel> switch, or set it manually by clicking the up and down arrows above and below the numbers. You can also select <guilabel>24-hour</guilabel> or <guilabel>AM/PM</guilabel> to enable or disable the 24-hour time format.
+      The <application>timedatectl</application> utility is distributed as part of the <systemitem class="daemon">systemd</systemitem> system and service manager and allows you to review and change the configuration of the system clock. You can use this tool to change the current date and time, set the time zone, or enable automatic synchronization of the system clock with a remote server.
     </para>
-    <indexterm>
-      <primary><application>Date and Time</application></primary>
-      <secondary>time zone settings</secondary>
-    </indexterm>
-    <indexterm>
-      <primary>time zone</primary>
-      <seealso><application>Date and Time</application></seealso>
-    </indexterm>
     <para>
-      To change the time zone, either click on the map, or select the region and city from the <guilabel>Region</guilabel> and <guilabel>City</guilabel> drop-down lists.
+      For information on how to display the current date and time in a custom format, see also <xref linkend="sect-Configuring_the_Date_and_Time-date" />.
     </para>
-    <indexterm>
-      <primary><application>Date and Time</application></primary>
-      <secondary>system date</secondary>
-    </indexterm>
-    <indexterm>
-      <primary>date</primary>
-      <seealso><application>Date and Time</application></seealso>
-    </indexterm>
-    <para>
-      To change the current date of your system, select a month from the drop-down list below the time, and use the up and down arrows to choose the day and year.
+    <section id="sect-Configuring_the_Date_and_Time-timedatectl-Display">
+      <title>Displaying the Current Date and Time</title>
+      <para>
+        To display the current date and time along with detailed information about the configuration of the system and hardware clock, run the <command>timedatectl</command> command with no additional command line options:
+      </para>
+      <synopsis><command>timedatectl</command></synopsis>
+      <para>
+        This displays the local and universal time, the currently used time zone, the status of the Network Time Protocol (<systemitem class="protocol">NTP</systemitem>) configuration, and additional information related to DST.
+      </para>
+      <example id="exam-Configuring_the_Date_and_Time-timedatectl-Display">
+        <title>Displaying the Current Date and Time</title>
+        <para>
+          The following is an example output of the <command>timedatectl</command> command on a system that does not use <systemitem class="protocol">NTP</systemitem> to synchronize the system clock with a remote server:
+        </para>
+        <screen>~]$&nbsp;<command>timedatectl</command>
+      Local time: Mon 2013-09-16 19:30:24 CEST
+  Universal time: Mon 2013-09-16 17:30:24 UTC
+        Timezone: Europe/Prague (CEST, +0200)
+     NTP enabled: no
+NTP synchronized: no
+ RTC in local TZ: no
+      DST active: yes
+ Last DST change: DST began at
+                  Sun 2013-03-31 01:59:59 CET
+                  Sun 2013-03-31 03:00:00 CEST
+ Next DST change: DST ends (the clock jumps one hour backwards) at
+                  Sun 2013-10-27 02:59:59 CEST
+                  Sun 2013-10-27 02:00:00 CET</screen>
+      </example>
+    </section>
+    <section id="sect-Configuring_the_Date_and_Time-timedatectl-Time">
+      <title>Changing the Current Time</title>
+      <para>
+        To change the current time, type the following at a shell prompt as <systemitem class="username">root</systemitem>:
+      </para>
+      <synopsis><command>timedatectl</command> <option>set-time</option> <replaceable>HH:MM:SS</replaceable></synopsis>
+      <para>
+      Replace <replaceable>HH</replaceable> with an hour, <replaceable>MM</replaceable> with a minute, and <replaceable>SS</replaceable> with a second, all typed in two-digit form. 
+      </para>
+      <para>
+      This command updates both the system time and the hardware clock. The result it is similar to using both the <command>date --set</command> and <command>hwclock --systohc</command> commands.
+      </para>
+      <example id="exam-Configuring_the_Date_and_Time-timedatectl-Time">
+        <title>Changing the Current Time</title>
+        <para>
+          To change the current time to 11:26 p.m., run the following command as <systemitem class="username">root</systemitem>:
+        </para>
+<screen>~]#&nbsp;<command>timedatectl set-time 23:26:00</command></screen>
+      </example>
+      <para>
+        By default, the system is configured to use UTC. To configure your system to maintain the clock in the local time, run the <command>timedatectl</command> command with the <option>set-local-rtc</option> option as <systemitem class="username">root</systemitem>:
+      </para>
+<synopsis><command>timedatectl</command> <option>set-local-rtc</option> <replaceable>boolean</replaceable></synopsis>
+      <para>
+        To configure your system to maintain the clock in the local time, replace <replaceable>boolean</replaceable> with <literal>yes</literal> (or, alternatively, <literal>y</literal>, <literal>true</literal>, <literal>t</literal>, or <literal>1</literal>). To configure the system to use UTC, replace <replaceable>boolean</replaceable> with <literal>no</literal> (or, alternatively, <literal>n</literal>, <literal>false</literal>, <literal>f</literal>, or <literal>0</literal>). The default option is <literal>no</literal>.
     </para>
+    </section>
+    <section id="sect-Configuring_the_Date_and_Time-timedatectl-Date">
+      <title>Changing the Current Date</title>
+      <para>
+        To change the current date, type the following at a shell prompt as <systemitem class="username">root</systemitem>:
+      </para>
+<synopsis><command>timedatectl</command> <option>set-time</option> <replaceable>YYYY-MM-DD</replaceable></synopsis>
+      <para>
+        Replace <replaceable>YYYY</replaceable> with a four-digit year, <replaceable>MM</replaceable> with a two-digit month, and <replaceable>DD</replaceable> with a two-digit day of the month. 
+      </para>
+       <para>
+        Note that changing the date without specifying the current time results in setting the time to 00:00:00.
+       </para>
+      <example id="exam-Configuring_the_Date_and_Time-timedatectl-Date">
+        <title>Changing the Current Date</title>
+        <para>
+          To change the current date to 2 June 2013 and keep the current time (11:26 p.m.), run the following command as <systemitem class="username">root</systemitem>:
+        </para>
+<screen>~]#&nbsp;<command>timedatectl set-time 2013-06-02 23:26:00</command></screen>
+      </example>
+    </section>
+    <section id="sect-Configuring_the_Date_and_Time-timedatectl-Time_Zone">
+      <title>Changing the Time Zone</title>
+      <para>
+        To list all available time zones, type the following at a shell prompt:
+      </para>
+      <synopsis><command>timedatectl</command> <option>list-timezones</option></synopsis>
+      <para>
+        To change the currently used time zone, type as <systemitem class="username">root</systemitem>:
+      </para>
+      <synopsis><command>timedatectl</command> <option>set-timezone</option> <replaceable>time_zone</replaceable></synopsis>
+      <para>
+        Replace <replaceable>time_zone</replaceable> with any of the values listed by the <command>timedatectl list-timezones</command> command.
+      </para>
+      <example id="exam-Configuring_the_Date_and_Time-timedatectl-Time_Zone">
+        <title>Changing the Time Zone</title>
+        <para>
+          To identify which time zone is closest to your present location, use the <command>timedatectl</command> command with the <option>list-timezones</option> command line option. For example, to list all available time zones in Europe, type:
+        </para>
+        <screen>~]#&nbsp;<command>timedatectl list-timezones | grep Europe</command>
+Europe/Amsterdam
+Europe/Andorra
+Europe/Athens
+Europe/Belgrade
+Europe/Berlin
+Europe/Bratislava
+<lineannotation>…</lineannotation></screen>
+        <para>
+          To change the time zone to <literal>Europe/Prague</literal>, type as <systemitem class="username">root</systemitem>:
+        </para>
+<screen>~]#&nbsp;<command>timedatectl set-timezone Europe/Prague</command></screen>
+      </example>
+    </section>
+    <section id="sect-Configuring_the_Date_and_Time-timedatectl-NTP">
+      <title>Synchronizing the System Clock with a Remote Server</title>
+      <para>
+      As opposed to the manual setup described in the previous sections, the <command>timedatectl</command> command also allows you to enable automatic synchronization of your system clock with a group of remote servers using <systemitem class="protocol">NTP</systemitem>. Enabling NTP enables the <systemitem class="service">chronyd</systemitem> or <systemitem class="service">ntpd</systemitem> service, depending on which of them is installed. 
+       </para>
+       <para>
+        To enable or disable NTP, type the following at a shell prompt as <systemitem class="username">root</systemitem>:
+      </para>
+      <synopsis><command>timedatectl</command> <option>set-ntp</option> <replaceable>boolean</replaceable></synopsis>
+      <para>
+        To configure your system to synchronize the system clock with a remote <systemitem class="protocol">NTP</systemitem> server, replace <replaceable>boolean</replaceable> with <literal>yes</literal> (the default option). To disable this feature, replace <replaceable>boolean</replaceable> with <literal>no</literal>.
+      </para>
+      <example id="exam-Configuring_the_Date_and_Time-timedatectl-NTP">
+        <title>Synchronizing the System Clock with a Remote Server</title>
+        <para>
+          To enable automatic synchronization of the system clock with a remote server, type:
+        </para>
+<screen>~]#&nbsp;<command>timedatectl set-ntp yes</command></screen>
+      </example>
+    </section>
+  </section>
+  <section id="sect-Configuring_the_Date_and_Time-date">
+    <title>Using the date Command</title>
     <para>
-      The changes take effect immediately.
+      The <command>date</command> utility is available on all Linux systems and allows you to display and configure the current date and time. It is frequently used in scripts to display detailed information about the system clock in a custom format.
     </para>
-  </section>
-  <section id="sect-Configuring_the_Date_and_Time-Command_Line_Configuration">
-    <title>Using the Command Line Tools</title>
     <para>
-      &MAJOROSVER; provides command line tools that allow you to configure the date and time both manually and using the <systemitem class="protocol">NTP</systemitem> protocol.
+      For information on how to change the time zone or enable automatic synchronization of the system clock with a remote server, see <xref linkend="sect-Configuring_the_Date_and_Time-timedatectl" />.
     </para>
-    <section id="sect-Configuring_the_Date_and_Time-Command_Line_Configuration-Date">
-      <title>Changing the Date</title>
-      <indexterm>
-        <primary>time</primary>
-      </indexterm>
-      <indexterm>
-        <primary><command>date</command></primary>
-      </indexterm>
+    <section id="sect-Configuring_the_Date_and_Time-date-Display">
+      <title>Displaying the Current Date and Time</title>
       <para>
-        To change the system date, type the following at a shell prompt as <systemitem class="username">root</systemitem>:
+        To display the current date and time, run the <command>date</command> command with no additional command line options:
       </para>
-      <screen><command>date +%D -s <replaceable>YYYY-MM-DD</replaceable></command></screen>
+      <synopsis><command>date</command></synopsis>
       <para>
-        &#8230;where <replaceable>YYYY</replaceable> is a four-digit year, <replaceable>MM</replaceable> is a two-digit month, and <replaceable>DD</replaceable> is a two-digit day of the month. For example, to change the date to 2 June 2010, type:
+        This displays the day of the week followed by the current date, local time, abbreviated time zone, and year.
       </para>
-      <screen>~]# <command>date +%D -s 2010-06-02</command></screen>
       <para>
-        You can verify the current settings by running <command>date</command> without any additional argument.
+        By default, the <command>date</command> command displays the local time. To display the time in UTC, run the command with the <option>--utc</option> or <option>-u</option> command line option:
       </para>
-    </section>
-
-    <section id="sect-Configuring_the_Date_and_Time-Command_Line_Configuration-Time">
-      <title>Changing the Time</title>
+      <synopsis><command>date</command> <option>--utc</option></synopsis>
       <para>
-        To change the current time, run the following command as <systemitem class="username">root</systemitem>:
+        You can also customize the format of the displayed information by providing the <option>+"<replaceable>format</replaceable>"</option> option on the command line:
       </para>
-      <screen><command>date +%T -s <replaceable>HH:MM:SS</replaceable></command></screen>
+      <synopsis><command>date</command> <option>+"<replaceable>format</replaceable>"</option></synopsis>
       <para>
-        &#8230;where <replaceable>HH</replaceable> stands for an hour, <replaceable>MM</replaceable> is a minute, and <replaceable>SS</replaceable> is a second, all typed in a two-digit form. If your system clock is set to use <acronym>UTC</acronym> (Coordinated Universal Time), also add the following option:
+        Replace <replaceable>format</replaceable> with one or more supported control sequences as illustrated in <xref linkend="exam-Configuring_the_Date_and_Time-date-Display" />. See <xref linkend="tabl-Configuring_the_Date_and_Time-date-Format" /> for a list of the most frequently used formatting options, or the <systemitem>date</systemitem>(1) manual page for a complete list of these options.
       </para>
-      <screen><command>date +%T -s <replaceable>HH:MM:SS</replaceable> -u</command></screen>
+      <table id="tabl-Configuring_the_Date_and_Time-date-Format">
+        <title>Commonly Used Control Sequences</title> 
+        <tgroup cols="2">
+          <colspec colname="sequence" colnum="1" colwidth="25*" />
+          <colspec colname="description" colnum="2" colwidth="75*" />
+          <thead>
+            <row>
+              <entry>Control Sequence</entry>
+              <entry>Description</entry>
+            </row>
+          </thead>
+          <tbody>
+            <row>
+              <entry>
+                <option>%H</option>
+              </entry>
+              <entry>
+                The hour in the <replaceable>HH</replaceable> format (for example, <literal>17</literal>).
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <option>%M</option>
+              </entry>
+              <entry>
+                The minute in the <replaceable>MM</replaceable> format (for example, <literal>30</literal>).
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <option>%S</option>
+              </entry>
+              <entry>
+                The second in the <replaceable>SS</replaceable> format (for example, <literal>24</literal>).
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <option>%d</option>
+              </entry>
+              <entry>
+                The day of the month in the <replaceable>DD</replaceable> format (for example, <literal>16</literal>).
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <option>%m</option>
+              </entry>
+              <entry>
+                The month in the <replaceable>MM</replaceable> format (for example, <literal>09</literal>).
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <option>%Y</option>
+              </entry>
+              <entry>
+                The year in the <replaceable>YYYY</replaceable> format (for example, <literal>2013</literal>).
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <literal>%Z</literal>
+              </entry>
+              <entry>
+                The time zone abbreviation (for example, <literal>CEST</literal>).
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <option>%F</option>
+              </entry>
+              <entry>
+                The full date in the <replaceable>YYYY-MM-DD</replaceable> format (for example, <literal>2013-09-16</literal>). This option is equal to <option>%Y-%m-%d</option>.
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <option>%T</option>
+              </entry>
+              <entry>
+                The full time in the <replaceable>HH:MM:SS</replaceable> format (for example, 17:30:24). This option is equal to <option>%H:%M:%S</option>
+              </entry>
+            </row>
+          </tbody>
+        </tgroup>
+      </table>
+      <example id="exam-Configuring_the_Date_and_Time-date-Display">
+        <title>Displaying the Current Date and Time</title>
+        <para>
+          To display the current date and local time, type the following at a shell prompt:
+        </para>
+        <screen>~]$&nbsp;<command>date</command>
+Mon Sep 16 17:30:24 CEST 2013</screen>
+        <para>
+          To display the current date and time in UTC, type the following at a shell prompt:
+        </para>
+        <screen>~]$&nbsp;<command>date --utc</command>
+Mon Sep 16 15:30:34 UTC 2013</screen>
+        <para>
+          To customize the output of the <command>date</command> command, type:
+        </para>
+        <screen>~]$&nbsp;<command>date +"%Y-%m-%d %H:%M"</command>
+2013-09-16 17:30</screen>
+     </example>
+    </section>
+    <section id="sect-Configuring_the_Date_and_Time-date-Time">
+      <title>Changing the Current Time</title>
       <para>
-        For instance, to set the system clock to 11:26 PM using the <acronym>UTC</acronym>, type:
+        To change the current time, run the <command>date</command> command with the <option>--set</option> or <option>-s</option> option as <systemitem class="username">root</systemitem>:
       </para>
-      <screen>~]# <command>date +%T -s 23:26:00 -u</command></screen>
+<synopsis><command>date</command> <option>--set</option> <replaceable>HH:MM:SS</replaceable></synopsis>
       <para>
-        You can verify the current settings by running <command>date</command> without any additional argument. You should not use this command to set the time if the system clock is being maintained by <application>chrony</application>, <systemitem class="daemon">ntpd</systemitem>, or any other similar automated process.
+        Replace <replaceable>HH</replaceable> with an hour, <replaceable>MM</replaceable> with a minute, and <replaceable>SS</replaceable> with a second, all typed in two-digit form.
       </para>
-    </section>
-    <section id="sect-Configuring_the_Date_and_Time-Command_Line_Configuration-Network_Time_Protocol">
-      <title>Configuring the Network Time Protocol</title>
-      <indexterm>
-        <primary>NTP</primary>
-        <see>Network Time Protocol</see>
-      </indexterm>
-      <indexterm>
-        <primary>Network Time Protocol</primary>
-      </indexterm>
-      <para>
-        Fedora includes the <application>chrony</application> suite of programs to automatically adjust the system clock using the <firstterm>Network Time Protocol</firstterm> (<acronym>NTP</acronym>). See <xref linkend="ch-Configuring_NTP_Using_the_chrony_Suite" /> for information on configuring and enabling <application>chrony</application>.</para>
       <para>
-        It is also possible to use <systemitem class="daemon">ntpd</systemitem> to adjust the system clock using the <firstterm>Network Time Protocol</firstterm> (<acronym>NTP</acronym>). See <xref linkend="ch-Configuring_NTP_Using_ntpd" /> for information on configuring <systemitem class="daemon">ntpd</systemitem>.</para>
+        By default, the <command>date</command> command sets the system clock to the local time. To set the system clock in UTC, run the command with the <option>--utc</option> or <option>-u</option> command line option:
+      </para>
+<synopsis><command>date</command> <option>--set</option> <replaceable>HH:MM:SS</replaceable> <option>--utc</option></synopsis>
+      <example id="exam-Configuring_the_Date_and_Time-date-Time">
+        <title>Changing the Current Time</title>
+        <para>
+          To change the current time to 11:26 p.m., run the following command as <systemitem class="username">root</systemitem>:
+        </para>
+<screen>~]#&nbsp;<command>date --set 23:26:00</command></screen>
+      </example>
     </section>
-
-    <!-- Hiding this as it no longer valid for Fedora 18. Should we link from here to the new chrony section?
-    <section id="sect-Configuring_the_Date_and_Time-Command_Line_Configuration-Network_Time_Protocol">
-      <title>Configuring the Network Time Protocol</title>
-      <indexterm>
-        <primary>NTP</primary>
-        <see>Network Time Protocol</see>
-      </indexterm>
-      <indexterm>
-        <primary>Network Time Protocol</primary>
-      </indexterm>
-      <indexterm>
-        <primary>Network Time Protocol</primary>
-        <secondary><command>ntpdate</command></secondary>
-      </indexterm>
-      <indexterm>
-        <primary><command>ntpdate</command></primary>
-      </indexterm>
+    <section id="sect-Configuring_the_Date_and_Time-date-Date">
+      <title>Changing the Current Date</title>
       <para>
-        As opposed to the manual setup described above, you can also synchronize the system clock with a remote server over the Network Time Protocol (<acronym>NTP</acronym>). For the one-time synchronization only, use the <application>ntpdate</application> command:
+        To change the current date, run the <command>date</command> command with the <option>--set</option> or <option>-s</option> option as <systemitem class="username">root</systemitem>:
       </para>
-      <procedure>
-        <step>
-          <para>
-            Check whether the selected NTP server is accessible by using the <command>ntpdate</command> command in the following form:
-          </para>
-          <screen><command>ntpdate -q <replaceable>server_address</replaceable></command></screen>
-          <para>
-            For example, to connect to <systemitem class="server">0.fedora.pool.ntp.org</systemitem>, type:
-          </para>
-          <screen>~]$ <command>ntpdate -q 0.fedora.pool.ntp.org</command>
-server 204.15.208.61, stratum 2, offset -39.275438, delay 0.16083
-server 69.65.40.29, stratum 2, offset -39.269122, delay 0.17191
-server 148.167.132.201, stratum 2, offset -39.270239, delay 0.20482
-17 Oct 17:41:09 ntpdate[10619]: step time server 204.15.208.61 offset -39.275438 sec</screen>
-        </step>
-        <step>
-          <para>
-            When you find a satisfactory server, as <systemitem class="username">root</systemitem>, run the <application>ntpdate</application> command followed with one or more server addresses:
-          </para>
-          <screen><command>ntpdate <replaceable>server_address&#8230;</replaceable></command></screen>
-          <para>
-            For instance:
-          </para>
-          <screen>~]# <command>ntpdate 0.fedora.pool.ntp.org 1.fedora.pool.ntp.org</command>
-17 Oct 17:42:13 ntpdate[10669]: step time server 204.15.208.61 offset -39.275436 sec</screen>
-          <para>
-            Unless an error message is displayed, the system time is now set. You can verify the current time by running the <command>date</command> command with no additional arguments.
-          </para>
-        </step>
-        <step performance="optional">
-          <para>
-            In most cases, these steps are sufficient. Only if you really need one or more system services to always use the correct time, enable running the <application>ntpdate</application> at boot time by running the following command as <systemitem class="username">root</systemitem>:
-          </para>
-          <screen><command>systemctl enable ntpdate.service</command></screen>
-          <para>
-            For more information about system services and their setup, refer to <xref linkend="ch-Services_and_Daemons" />.
-          </para>
-          <note>
-            <title>Note</title>
-            <para>
-              If the synchronization with the time server at boot time keeps failing, that is, you find a relevant error message in the <filename>/var/log/boot.log</filename> system log, try to add the following line to <filename>/etc/sysconfig/network</filename>:
-            </para>
-            <screen>NETWORKWAIT=1</screen>
-          </note>
-        </step>
-      </procedure>
-      <indexterm>
-        <primary>NTP</primary>
-        <see>Network Time Protocol</see>
-      </indexterm>
-      <indexterm>
-        <primary>Network Time Protocol</primary>
-      </indexterm>
-      <indexterm>
-        <primary>Network Time Protocol</primary>
-        <secondary><command>ntpd</command></secondary>
-      </indexterm>
-      <indexterm>
-        <primary><command>ntpd</command></primary>
-      </indexterm>
+<synopsis><command>date</command> <option>--set</option> <replaceable>YYYY-MM-DD</replaceable></synopsis>
       <para>
-        However, the more convenient way is to set the <systemitem class="service">ntpd</systemitem> daemon to synchronize the time at boot time automatically:
-      </para>
-      <procedure>
-        <step>
-          <para>
-            As <systemitem class="username">root</systemitem>, open the NTP configuration file <filename>/etc/ntp.conf</filename> in a text editor, creating a new one if it does not already exist.
-          </para>
-        </step>
-        <step>
-          <para>
-            Add or edit the list of public NTP servers. If you are using &MAJOROSVER;, the file should already contain the following lines, but feel free to change or expand these according to your needs:
-          </para>
-          <screen>server 0.fedora.pool.ntp.org iburst
-server 1.fedora.pool.ntp.org iburst
-server 2.fedora.pool.ntp.org iburst</screen>
-          <note>
-            <title>Speeding up initial synchronization</title>
-            <para>
-              To speed the initial synchronization up, it is recommended that the <command>iburst</command> directive is added at the end of each server line.
-            </para>
-          </note>
-        </step>
-        <step>
-          <para>
-            In the same file, set the proper permissions, giving the unrestricted access to localhost only:
-          </para>
-          <screen>restrict default kod nomodify notrap nopeer noquery
-restrict -6 default kod nomodify notrap nopeer noquery
-restrict 127.0.0.1
-restrict -6 ::1</screen>
-        </step>
-        <step>
-          <para>
-            Save the changes, exit the editor, and restart the NTP daemon:
-          </para>
-          <screen><command>systemctl restart ntpd.service</command></screen>
-        </step>
-        <step>
-          <para>
-            Additionally, make sure that <command>ntpd</command> daemon is started at boot time:
-          </para>
-          <screen><command>systemctl enable ntpd.service</command></screen>
-        </step>
-      </procedure>
-    </section> -->
+        Replace <replaceable>YYYY</replaceable> with a four-digit year, <replaceable>MM</replaceable> with a two-digit month, and <replaceable>DD</replaceable> with a two-digit day of the month.
+       </para>
+       <para>
+        Note that changing the date without specifying the current time results in setting the time to 00:00:00.
+       </para>
+      <example id="exam-Configuring_the_Date_and_Time-date-Date">
+        <title>Changing the Current Date</title>
+        <para>
+          To change the current date to 2 June 2013 and keep the current time (11:26 p.m.), run the following command as <systemitem class="username">root</systemitem>:
+        </para>
+<screen>~]#&nbsp;<command>date --set 2013-06-02 23:26:00</command></screen>
+      </example>
+    </section>
   </section>
-  <section id="sect-Configuring_the_Date_and_Time-Additional_Resources">
-    <title>Additional Resources</title>
+  <section id="sect-Configuring_the_Date_and_Time-hwclock">
+    <title>Using the hwclock Command</title>
+  <para>
+  <systemitem>hwclock</systemitem> is a utility for accessing the hardware clock, also referred to as the Real Time Clock (RTC). The hardware clock is independent of the operating system you use and works even when the machine is shut down. This utility is used for displaying the time from the hardware clock. <systemitem>hwclock</systemitem> also contains facilities for compensating for systematic drift in the hardware clock. 
+  </para>
+  <para>
+  The hardware clock stores the values of: year, month, day, hour, minute, and second. It is not able to store the time standard, local time or Coordinated Universal Time (UTC), nor set the Daylight Saving Time (DST). 
+  </para>
+    <para>
+   The <systemitem>hwclock</systemitem> utility saves its settings in the <filename>/etc/adjtime</filename> file, which is created with the first change you make, for example, when you set the time manually or synchronize the hardware clock with the system time.
+    </para>
+   <note>
+  	<para>
+In &MAJOROS;&nbsp;6, the <command>hwclock</command> command was run automatically on every system shutdown or reboot, but it is not in &MAJOROSVER;. When the system clock is synchronized by the Network Time Protocol (NTP) or
+Precision Time Protocol (PTP), the kernel automatically synchronizes the hardware clock to the system clock every 11 minutes.
+    </para>
+  </note>
+    <para>
+For details about NTP, see <xref linkend="ch-Configuring_NTP_Using_the_chrony_Suite" /> and <xref linkend="ch-Configuring_NTP_Using_ntpd" />. For information about PTP, see <xref linkend="ch-Configuring_PTP_Using_ptp4l" />. For information about setting the hardware clock after executing <application>ntpdate</application>, see <xref linkend="s1-Configuring_the_Hardware_Clock_update" />.
+    </para>
+    <section id="sect2-displaying-time-hwclock">
+  	<title>Displaying the Current Date and Time</title>
+  <para>
+  Running <command>hwclock</command> with no command line options as the <systemitem class="username">root</systemitem> user returns the date and time in local time to standard output.
+  </para>
+  <synopsis><command>hwclock</command></synopsis>
+  <para>
+  Note that using the <option>--utc</option> or <option>--localtime</option> options with the <command>hwclock</command> command does not mean you are displaying the hardware clock time in UTC or local time. These options are used for setting the hardware clock to keep time in either of them. The time is always displayed in local time. Additionally, using the <command>hwclock --utc</command> or <command>hwclock --local</command> commands does not change the record in the <filename>/etc/adjtime</filename> file. This command can be useful when you know that the setting saved in <filename>/etc/adjtime</filename> is incorrect but you do not want to change the setting. On the other hand, you may receive misleading information if you use the command an incorrect way. See the <systemitem>hwclock</systemitem>(8) manual page for more details.
+  </para>
+  <example id="exam-sect3-displaying-time-hwclock">
+  	<title>Displaying the Current Date and Time</title>
+  	<para>
+  To display the current date and the current local time from the hardware clock, run as <systemitem class="username">root</systemitem>: 
+  	</para>
+<screen>~]#&nbsp;<command>hwclock</command>
+Tue 15 Apr 2014 04:23:46 PM CEST     -0.329272 seconds</screen>
+  <para>
+  CEST is a time zone abbreviation and stands for Central European Summer Time.
+  </para>
+  </example>
+  <para>
+     For information on how to change the time zone, see <xref linkend="sect-Configuring_the_Date_and_Time-timedatectl-Time_Zone" />.
+  </para>
+    </section>
+    <section id="sect3-changing-date-time-hwclock">
+  <title>Setting the Date and Time</title>
+    <para>
+  Besides displaying the date and time, you can manually set the hardware clock to a specific time.
+  </para>
     <para>
-      For more information about the date and time configuration, refer to the following resources.
+  When you need to change the hardware clock date and time, you can do so by appending the <option>--set</option> and <option>--date</option> options along with your specification:
     </para>
-    <section id="sect-Configuring_the_Date_and_Time-Additional_Resources-Installed_Documentation">
-      <title>Installed Documentation</title>
-      <itemizedlist>
-        <listitem>
-          <para>
-            <literal>date</literal>(1) — The manual page for the <application>date</application> utility.
-          </para>
-        </listitem>
-        <!-- Hiding as not valid in Fedora 18
-        <listitem>
-          <para>
-            <literal>ntpdate</literal>(8) — The manual page for the <application>ntpdate</application> utility.
-          </para>
-        </listitem>
-        <listitem>
-          <para>
-            <literal>ntpd</literal>(8) — The manual page for the <systemitem class="service">ntpd</systemitem> service.
-          </para>
-        </listitem> -->
-      </itemizedlist>
+<synopsis><command>hwclock --set --date <replaceable>"dd mmm yyyy HH:MM"</replaceable></command></synopsis>
+  <para>
+  Replace <replaceable>dd</replaceable> with a day (a two-digit number), <replaceable>mmm</replaceable> with a month (a three-letter abbreviation), <replaceable>yyyy</replaceable> with a year (a four-digit number), <replaceable>HH</replaceable> with an hour (a two-digit number), <replaceable>MM</replaceable> with a minute (a two-digit number).
+  </para>
+  <para>
+  At the same time, you can also set the hardware clock to keep the time in either UTC or local time by adding the <option>--utc</option> or <option>--localtime</option> options, respectively. In this case, <literal>UTC</literal> or <literal>LOCAL</literal> is recorded in the <filename>/etc/adjtime</filename> file.
+  </para>
+    <example id="exam6-sect3-setting-time-hwclock">
+  	<title>Setting the Hardware Clock to a Specific Date and Time</title>
+   	<para>
+  If you want to set the date and time to a specific value, for example, to "21:17, October 21, 2014", and keep the hardware clock in UTC, run the command as <systemitem class="username">root</systemitem> in the following format:
+  	</para>
+<screen>~]#&nbsp;<command>hwclock --set --date "21 Oct 2014 21:17" --utc</command></screen>
+  </example>
     </section>
+    <section id="sect4-synchronizing-date-time-hwclock">
+  <title>Synchronizing the Date and Time</title>
+  <para>
+You can synchronize the hardware clock and the current system time in both directions.
+  </para>
+  <itemizedlist>
+  	<listitem>
+  		<para>
+  Either you can set the hardware clock to the current system time by using this command: 
+  		</para>
+<synopsis><command>hwclock --systohc</command></synopsis>
+    <para>
+   Note that if you use NTP, the hardware clock is automatically synchronized to the system clock every 11 minutes, and this command is useful only at boot time to get a reasonable initial system time.
+    </para>
+    </listitem>
+  	<listitem>
+  		<para>
+  Or, you can set the system time from the hardware clock by using the following command:
+  		</para>
+<synopsis><command>hwclock --hctosys</command></synopsis>
+  	</listitem>
+  </itemizedlist>
+  <para>
+    When you synchronize the hardware clock and the system time, you can also specify whether you want to keep the hardware clock in local time or UTC by adding the <option>--utc</option> or <option>--localtime</option> option. Similarly to using <option>--set</option>, <literal>UTC</literal> or <literal>LOCAL</literal> is recorded in the <filename>/etc/adjtime</filename> file.
+  </para>
+  <para>
+    The <command>hwclock --systohc --utc</command> command is functionally similar to <command>timedatectl set-local-rtc false</command> and the <command>hwclock --systohc --local</command> command is an alternative to <command>timedatectl set-local-rtc true</command>.
+  </para>
+    <example id="exam4-sect4-synchornizing-systohc-hwclock">
+  	<title>Synchronizing the Hardware Clock with System Time</title>
+  	<para>
+To set the hardware clock to the current system time and keep the hardware clock in local time, run the following command as <systemitem class="username">root</systemitem>:	
+  	</para>
+<screen>~]#&nbsp;<command>hwclock --systohc --localtime</command></screen>
+  <para>
+   To avoid problems with time zone and DST switching, it is recommended to keep the hardware clock in UTC. The shown <xref linkend="exam4-sect4-synchornizing-systohc-hwclock" /> is useful, for example, in case of a multi boot with a Windows system, which assumes the hardware clock runs in local time by default, and all other systems need to accommodate to it by using local time as well. It may also be needed with a virtual machine; if the virtual hardware clock provided by the host is running in local time, the guest system needs to be configured to use local time, too.
+  </para>
+    </example>
+    </section>
+  </section>
+  <section id="sect-Date_and_Time-Resources">
+    <title>Additional Resources</title>
+    <para>
+      For more information on how to configure the date and time in &MAJOROSVER;, see the resources listed below.
+    </para>
+    <bridgehead id="brid-Date_and_Time-Resources-Installed">Installed Documentation</bridgehead>
+    <itemizedlist>
+      <listitem>
+        <para>
+          <systemitem>timedatectl</systemitem>(1) — The manual page for the <command>timedatectl</command> command line utility documents how to use this tool to query and change the system clock and its settings.
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+          <systemitem>date</systemitem>(1) — The manual page for the <command>date</command> command provides a complete list of supported command line options.
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+          <systemitem>hwclock</systemitem>(8) — The manual page for the <command>hwclock</command> command provides a complete list of supported command line options.
+        </para>
+      </listitem>
+    </itemizedlist>
+    <bridgehead id="brid-Date_and_Time-Resources-Also">See Also</bridgehead>
+    <itemizedlist>
+      <listitem>
+        <para>
+          <xref linkend="ch-Configuring_the_Language_and_Keyboard" /> documents how to configure the keyboard layout.
+        </para>
+      </listitem>
+      <!--<listitem>
+        <para>
+          <xref linkend="chap-Gaining_Privileges" /> documents how to gain administrative privileges by using the <command>su</command> and <command>sudo</command> commands.
+        </para>
+      </listitem>-->
+      <!--<listitem>
+        <para>
+          <xref linkend="chap-Managing_Services_with_systemd" /> provides more information on systemd and documents how to use the <command>systemctl</command> command to manage system services.
+        </para>
+      </listitem>-->
+    </itemizedlist>
   </section>
 </chapter>


More information about the docs-commits mailing list