This artcile offers instructions on how to change or set timezone on RHEL 8 / CentOS 8 server or GNOME workstation using the command line tool timedatectl
.
In this tutorial you will learn:
- How to retrieve current timezone.
- How to change/set timezone.
Software Requirements and Conventions Used
Category | Requirements, Conventions or Software Version Used |
---|---|
System | Red Hat Enterprise Linux 8 |
Software | N/A |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions |
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ – requires given linux commands to be executed as a regular non-privileged user |
How to change timezone on Redhat 8 step by step instructions
- Check the current timezone settings. To do so execute the
timedatectl
command without any additional options or arguments:$ timedatectl Local time: Mon 2018-11-26 13:57:59 EST Universal time: Mon 2018-11-26 18:57:59 UTC RTC time: Sat 2018-11-17 03:44:16 Time zone: America/New_York (EST, -0500) System clock synchronized: yes NTP service: active RTC in local TZ: no
- List all available timezones using the
timedatectl
command. Use thegrep
command to search for a specific string, eg. country or city:$ timedatectl list-timezones | grep -i europe Europe/Amsterdam Europe/Andorra Europe/Astrakhan Europe/Athens Europe/Belgrade Europe/Berlin Europe/Bratislava ... Europe/Volgograd Europe/Warsaw Europe/Zagreb Europe/Zaporozhye Europe/Zurich
Take a note of the selected timezone.
- Using the
timedatectl
command set the new timezone. As an administrator user executing the below command will set the timezone to eg.Europe/Bratislava
:$ su # timedatectl set-timezone Europe/Bratislava
- In the last step confirm the correct new timezone settings:
$ timedatectl Local time: Mon 2018-11-26 20:05:17 CET Universal time: Mon 2018-11-26 19:05:17 UTC RTC time: Sat 2018-11-17 03:51:34 Time zone: Europe/Bratislava (CET, +0100) System clock synchronized: yes NTP service: active RTC in local TZ: no