Change Time Zone for RHEL/CentOS and Fedora
This post shows how to query and set the time zone in the command line on RHEL 8, CentOS 8 and Fedora 30. The command line tool
timedatectl use to check and modify time zone setting.
Run the query using
timedatectl without additional arguments:
$ timedatectl Local time: Wed 2021-02-17 17:04:29 GMT Universal time: Wed 2021-02-17 17:04:29 UTC RTC time: Wed 2021-02-17 16:57:58 Time zone: Europe/London (GMT, +0000) System clock synchronized: yes NTP service: active RTC in local TZ: no
Now set the time zone to another zone:
$ sudo timedatectl set-timezone Europe/Zurich
To query the changed time zone setting:
$ timedatectl Local time: Wed 2021-02-17 18:05:58 GMT Universal time: Wed 2021-02-17 17:05:58 UTC RTC time: Wed 2021-02-17 16:59:27 Time zone: Europe/Zurich (CET, +0100) System clock synchronized: yes NTP service: active RTC in local TZ: no
The available time zones showing with the following command:
$ timedatectl list-timezones
Since there are many time zones, the query becomes very long; the query can be narrowed down with grep:
$ timedatectl list-timezones | grep Europe
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?