Blog Image

How to Change Timezone in CentOS

You check the time from the command line (run date), and find that the timezone is set to UTC or some other timezone. How do you get this changed?
To change this you have to have root access to the server.

There are a series of time zone files located at /usr/share/zoneinfo. Select the appropriate named timezone for your location. For my location I would need , Kolkata, Asia.

Make note of the appropriate folder and file for your timezone. The active timezone used on your system is in the /etc/localtime file.

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

sudo mv /etc/localtime /etc/localtime.bak_01012015

Next, create the link:

sudo ln -s /usr/share/zoneinfo/Asia/Kolkata /etc/localtime

To test your change run the date command. You will see the new time.



Author: admin

Vinod Ram has been in Software Industry since 2006 and has experience of over 16 years in Software Development & Project Management domain specialised majorly in LAMP stack & Open Source Technology, building enterprise level Web based Application, Large Database driven and huge traffic Websites and Project Management. He loves to write information articles and blog to share his knowledge and experience with the outside world and help people to find solution for their problems.