Linux Systemzeit Synchronisation mit Network Time Protocol und Zeitzoneneinstellungen festlegen und abfragen

How to Set Linux Time Zone in Console

0
(0)

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

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

Leave a Reply

Your email address will not be published. Required fields are marked *