- Setup CentOS server

Usually in Centos and RHEL 6 systems a soft link is enough to change the Timezone. On RHEL 7 a few things have change. Anyway. In this post I will show you how to Change Timezone Centos / RHEL 7 systems, plus the old way for 6.

Change Timezone Centos / RHEL 7 systems

CentOS timezone configuarion files and directories which contain the timezone information

  1. /usr/share/zoneinfo/ – The system timezone directory contains the files. For example, the file/usr/share/zoneinfo/Europe/Athens represents time zone for Athens, Greece.
  2. /etc/localtime – It’s a symlink to the file localtime or to the correct timezone file in the system located in /usr/share/zoneinfo/ directory.


How do I see the current time zone?

Type date command or the ls command:
$ date
$ ls -l /etc/localtime



Change Timezone Centos / RHEL 7 systems

To find and list of all available time zones, execute:
# timedatectl list-timezones
##*** Grep my timezone, in my case Europe/Athens ***##
# timedatectl list-timezones | grep Athens



The syntax is as follows to set timezone and and it needs superuser (root) privileges:

# timedatectl set-timezone time_zone

In this example, I will set timezone to Europe/Athens

# timedatectl set-timezone Europe/Athens

Verify fresh changed settings by typing the following two commands:
# date
# ls -l /etc/localtime

Change the current timezone in CentOS / RHEL 6 systems and older

Type the following commands always as root:

cp /etc/localtime /root/old.timezone
rm /etc/localtime
ln -s /usr/share/zoneinfo/Europe/Athens /etc/localtime

Verify new settings by typing the following commands to doublecheck:

ls -l /etc/localtime


Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.