Problem

How to change time zone in CentOS/RedHat Linux?

Analysis

There is a symbolic link in /etc which links to a file in /usr/share/zoneinfo directory.

Solution

First, make a backup of the existing localtime file. It’s always good practice to make backups of original config files.

mv /etc/localtime /etc/localtime.bak

Next, create the link:

ln -s /usr/share/zoneinfo/Europe/Bratislava /etc/localtime
Change Europe/Bratislava to your country/town.
Check if the date is correct:
$ date

References

Change time zone in CentOS Linux

Leave a Reply

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