Chapter 3. Configuring the Date and Time
- A real-time clock (RTC), commonly referred to as a hardware clock, (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.
- A system clock, also known as a software clock, 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.
timedatectl utility, which is new in Red Hat Enterprise Linux 7 and is part of systemd; the traditional date command; and the hwclock utility for accessing the hardware clock.
3.1. Using the timedatectl Command
systemd 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.
3.1.1. Displaying the Current Date and Time
timedatectl command with no additional command line options:
timedatectlNTP) configuration, and additional information related to DST.
Example 3.1. Displaying the Current Date and Time
timedatectl command on a system that does not use NTP to synchronize the system clock with a remote server:
~]$ timedatectl
Local time: Mon 2016-09-16 19:30:24 CEST
Universal time: Mon 2016-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 2016-03-31 01:59:59 CET
Sun 2016-03-31 03:00:00 CEST
Next DST change: DST ends (the clock jumps one hour backwards) at
Sun 2016-10-27 02:59:59 CEST
Sun 2016-10-27 02:00:00 CETImportant
chrony or ntpd will not be immediately noticed by timedatectl. If changes to the configuration or status of these tools is made, enter the following command:
~]# systemctl restart systemd-timedated.service
3.1.2. Changing the Current Time
root:
timedatectlset-timeHH:MM:SS
date --set and hwclock --systohc commands.
NTP service is enabled. See Section 3.1.5, “Synchronizing the System Clock with a Remote Server” to temporally disable the service.
Example 3.2. Changing the Current Time
root:
~]# timedatectl set-time 23:26:00timedatectl command with the set-local-rtc option as root:
timedatectlset-local-rtcboolean
yes (or, alternatively, y, true, t, or 1). To configure the system to use UTC, replace boolean with no (or, alternatively, n, false, f, or 0). The default option is no.
3.1.3. Changing the Current Date
root:
timedatectlset-timeYYYY-MM-DD
Example 3.3. Changing the Current Date
root:
~]# timedatectl set-time 2017-06-02 23:26:00 3.1.4. Changing the Time Zone
timedatectllist-timezones
root:
timedatectlset-timezonetime_zone
timedatectl list-timezones command.
Example 3.4. Changing the Time Zone
timedatectl command with the list-timezones command line option. For example, to list all available time zones in Europe, type:
~]# timedatectl list-timezones | grep Europe
Europe/Amsterdam
Europe/Andorra
Europe/Athens
Europe/Belgrade
Europe/Berlin
Europe/Bratislava
…Europe/Prague, type as root:
~]# timedatectl set-timezone Europe/Prague3.1.5. Synchronizing the System Clock with a Remote Server
timedatectl command also allows you to enable automatic synchronization of your system clock with a group of remote servers using the NTP protocol. Enabling NTP enables the chronyd or ntpd service, depending on which of them is installed.
NTP service can be enabled and disabled using a command as follows:
timedatectlset-ntpboolean
NTP server, replace boolean with yes (the default option). To disable this feature, replace boolean with no.
Example 3.5. Synchronizing the System Clock with a Remote Server
~]# timedatectl set-ntp yesNTP service is not installed. See Section 17.3.1, “Installing chrony” for more information.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.