How To Set or Change Timezone on CentOS 7

On CentOS, the system’s timezone is set during the install, but it can be easily changed at a later time. Using the correct timezone is important for many systems related tasks and processes. For example, the cron daemon uses the system’s timezone for executing cron jobs and the timestamps in the log files are based on the same system’s timezone.
To set up the time and date on CentOS 7 we are going to use the timedatectl command. It is an utility which is distributed as part of the systemd system and service manager. The timedatectl command has the following features:

  • Review the current date and time
  • Change the date and time
  • Set up the system time zone
  • Enable an automatic synchronization of the system clock with a remote server

This tutorial explains how to set or change the timezone on CentOS 7.x.


You’ll need to be logged in as a user with sudo privileges in order to change the system’s timezone.

Checking the Current Timezone

To display the current time and date on your system, use the timedatectl command from the commandline as follows:


As the output below shows, the system’s timezone is set to UTC:

$ timedatectl status
      Local time: Fri 2019-04-05 07:38:35 EDT
  Universal time: Fri 2019-04-05 11:38:35 UTC
        RTC time: Fri 2019-04-05 11:38:33
       Time zone: America/New_York (EDT, -0400)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2019-03-10 01:59:59 EST
                  Sun 2019-03-10 03:00:00 EDT
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2019-11-03 01:59:59 EDT
                  Sun 2019-11-03 01:00:00 EST

The system timezone is configured by symlinking /etc/localtime to a binary timezone identifier in the /usr/share/zoneinfo directory. So, another option to check the timezone is to show the path the symlink points to using the ls command:

ls -l /etc/localtime

Example output:

$ ls -l /etc/localtime
lrwxrwxrwx. 1 root root 38 Mar 13 17:33 /etc/localtime -> ../usr/share/zoneinfo/America/New_York

Changing Timezone in CentOS

Before changing the timezone, you’ll need to find out the long name for the timezone you want to use. The timezone naming convention usually uses a “Region/City” format. To view all available timezones, run the command below:

timedatectl list-timezones

Example output:

$ timedatectl list-timezones

To find the local timezone according to your location, run the following command:

timedatectl list-timezones |  egrep  -o "Asia/B.*"
timedatectl list-timezones |  egrep  -o "Europe/B.*"
timedatectl list-timezones |  egrep  -o "America/N.*"

Once you identify which time zone is accurate to your location, run the following command as sudo user:

sudo timedatectl set-timezone your_time_zone

For example, to change the system’s timezone to Europe/Belgrade:

sudo timedatectl set-timezone Europe/Belgrade

Run the timedatectl command to verify the changes:

Change timezone
Change timezone


In this guide, we have shown you change your CentOS system’s timezone. Feel free to leave a comment if you have any questions.

See also:Change Time Zone in Debian 10 / Debian 9

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.

Check Also
Back to top button