mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-07-18 02:05:06 +01:00
git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/systemd/BOOK@10389 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
64 lines
2.6 KiB
XML
64 lines
2.6 KiB
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
|
%general-entities;
|
|
]>
|
|
|
|
<sect1 id="ch-scripts-clock">
|
|
<?dbhtml filename="clock.html"?>
|
|
|
|
<title>Configuring the system clock</title>
|
|
|
|
<indexterm zone="ch-scripts-clock">
|
|
<primary sortas="d-clock">clock</primary>
|
|
<secondary>configuring</secondary></indexterm>
|
|
|
|
<para>This section discusses how to configure the
|
|
<command>systemd-timedated</command> system service, which configures
|
|
system clock and timezone.</para>
|
|
|
|
<para>Systemd provides a <command>timedatectl</command> utility which is
|
|
used to communicate with <command>systemd-timedated</command>. It can be used
|
|
to set the system clock in local time or UTC time, depending on the hardware
|
|
clock setting. By default, <command>systemd-timedated</command> will assume
|
|
that clock is set to UTC time.</para>
|
|
|
|
<para>If you cannot remember whether or not the hardware clock is set to UTC,
|
|
find out by running the <userinput>hwclock --localtime --show</userinput>
|
|
command. This will display what the current time is according to the hardware
|
|
clock. If this time matches whatever your watch says, then the hardware clock is
|
|
set to local time. If the output from <command>hwclock</command> is not local
|
|
time, chances are it is set to UTC time. Verify this by adding or subtracting
|
|
the proper amount of hours for the timezone to the time shown by
|
|
<command>hwclock</command>. For example, if you are currently in the MST
|
|
timezone, which is also known as GMT -0700, add seven hours to the local
|
|
time.</para>
|
|
|
|
<para>If your clock is set to local time, tell <command>systemd-timedated</command>
|
|
about it by running the following command:</para>
|
|
|
|
<screen role="nodump"><userinput>timedatectl set-local-rtc 1</userinput></screen>
|
|
|
|
<para><command>timedatectl</command> can also be used to change system time and
|
|
time zone.</para>
|
|
|
|
<para>To change your current system time, issue:</para>
|
|
|
|
<screen role="nodump"><userinput>timedatectl set-time YYYY:MM:DD HH:MM:SS</userinput></screen>
|
|
|
|
<para>Hardware clock will also be updated accordingly.</para>
|
|
|
|
<para>To change your current time zone, issue:</para>
|
|
|
|
<screen role="nodump"><userinput>timedatectl set-timezone TIMEZONE</userinput></screen>
|
|
|
|
<para>You can get list of available time zones by running:</para>
|
|
|
|
<screen role="nodump"><userinput>timedatectl list-timezones</userinput></screen>
|
|
|
|
<note><para>Please note that <command>timedatectl</command> command can
|
|
be used only on a system booted with Systemd.</para></note>
|
|
|
|
</sect1>
|