How to set timezone in Red Hat or CentOS

To set the timezone in RedHat or CentOS, first unlink the current timezone:

sudo unlink /etc/localtime

Find out which timezone you want to use by running ls in the zoneinfo directory:

ls /usr/share/zoneinfo

Then run another ls in the subdirectory you want, in my case, Europe:

ls /usr/share/zoneinfo/Europe

Select the capital of your city, and link it to /etc/localtime:

sudo ln -s /usr/share/zoneinfo/Europe/Stockholm /etc/localtime

Now the command date should show your new timezone.

Leave a Reply

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