How To Change Timezone on a CentOS 6 and 7

You can change the timezone on a CentOS 6 and 7 system using the following steps:

  1. Determine the correct timezone:
timedatectl list-timezones

This will display a list of available timezones. Look for the timezone you want to use and make a note of its name.

  1. Change the timezone:
sudo timedatectl set-timezone <Timezone_Name>

Replace <Timezone_Name> with the name of the timezone you want to use, for example:

sudo timedatectl set-timezone America/New_York
  1. Verify the timezone change:
date

This should display the current date and time with the newly set timezone.

Note that these steps require root or superuser privileges. If you do not have root access, you can change the timezone by editing the /etc/localtime file. To do this, copy the correct timezone file from /usr/share/zoneinfo/ to /etc/localtime. For example, to set the timezone to America/New_York:

sudo cp /usr/share/zoneinfo/America/New_York /etc/localtime

Leave a Comment