Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

timedatectl

Show and change the system time, the time zone, the RTC mode and whether NTP sync is on.

Level
RHCSA exam
Group
Time
Needs root
For changes
Package
systemd

What it does

Without arguments timedatectl shows local time, UTC, RTC time, time zone, whether the clock is synchronized and whether the NTP service (chronyd) is active. Subcommands change these settings.

How to write it

timedatectl [OPTION]... [COMMAND]

Main parts

status
Show the settings (default).
show
Settings as key=value (for scripts).
set-time "YYYY-MM-DD HH:MM:SS"
Set the clock (NTP must be off).
set-timezone ZONE
Set the time zone.
list-timezones
All zone names.
set-local-rtc 0|1
RTC in UTC (0) or local time (1).
set-ntp true|false
Turn NTP sync (chronyd) on or off.
timesync-status, show-timesync, ntp-servers, revert
For systemd-timesyncd (not used by default on RHEL).

Options 11

Most used

--adjust-system-clock
With set-local-rtc: also set the system clock from the RTC.
-p, --property=NAME
With show: only these properties.
-a, --all
With show: all properties.
--value
With show: only the values.
--monitor
With timesync-status: keep updating.
--no-ask-password
No password questions.
--no-pager
Do not use a pager.
-H, --host=HOST
Remote host over SSH.
-M, --machine=NAME
A container.
-h, --help
Show help.
--version
Show the version.

Examples 10

$ run as a normal user# run as root (or with sudo)

  1. 1Show all settings

    timedatectl
                   Local time: Sun 2026-10-25 11:42:10 +03
               Universal time: Sun 2026-10-25 08:42:10 UTC
                     RTC time: Sun 2026-10-25 08:42:10
                    Time zone: Asia/Riyadh (+03, +0300)
    System clock synchronized: yes
                  NTP service: active
              RTC in local TZ: no

    Everything at once.

  2. 2Set the time zone

    timedatectl set-timezone Asia/Riyadh

    Changes the /etc/localtime link.

  3. 3Find a zone name

    timedatectl list-timezones | grep -i amsterdam
    Europe/Amsterdam

    Exact names are needed.

  4. 4Turn NTP on

    timedatectl set-ntp true

    Starts and enables chronyd.

  5. 5Set the time by hand

    timedatectl set-ntp false
    timedatectl set-time "2026-10-25 12:00:00"

    Only for labs without a time server.

  6. 6RTC in UTC

    timedatectl set-local-rtc 0

    Recommended for servers.

  7. 7Value for a script

    timedatectl show -p NTPSynchronized --value
    yes

    Monitoring check.

  8. 8Check many servers

    for h in server1 server2; do ssh $h timedatectl show -p Timezone --value; done

    Same zone everywhere?

  9. 9Time zone link

    ls -l /etc/localtime
    lrwxrwxrwx. 1 root root 33 Oct 25 11:40 /etc/localtime -> ../usr/share/zoneinfo/Asia/Riyadh

    What set-timezone changed.

  10. 10Unsynced clock alert (security)

    [ "$(timedatectl show -p NTPSynchronized --value)" = yes ] || echo "clock not synced"

    Wrong time breaks TLS, Kerberos and log analysis.

Exit codes

0 :: Done. 1 :: Error.