How to Change Time Zone on CentOS 6?

by | 3 Nov 2015 | CentOS, Linux, OS, Technology | 2 comments

Always having difficulty on how to change time zone on CentOS 6? Just bookmark this page and everything will be solved.

Identify your current time zone

There are two ways to identify your current time zone.

date

or

ls -l /etc/localtime

Change time zone

Change “Amercia/Chicago” to the respective time zone that you want.

cp /etc/localtime /root/old.timezone
rm /etc/localtime
ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime

 

[Additional] Change PHP time zone

nano /etc/php.ini

Search for this line

;date.timezone =

Change it to

date.timezone = Asia/Singapore

Of course change it the time zone you want it to be

 

After running the commands above, remember to run the first step again to check that your time zone has been updated successfully.

That’s it. Changing CentOS 6 time zone is as simple as this.

2 Comments

  1. Hosting

    This made it a lot easier, thanks. I m hoping this change in server time will reflect on Awstats so the reports are in sync with my local time.

    Reply
  2. Hebergeur

    Be sure to reboot your SQL server. Otherwise it will continue to operate in the old time zone. This can cause problems that are hard to debug.

    Reply

Submit a Comment

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

Related Posts

APCCentOSFedoraLinuxOSPHPProgrammingServerTechnology
Install APC (Alternative PHP Cache) in CentOS 5/6/7 and Fedora 20/21

Install APC (Alternative PHP Cache) in CentOS 5/6/7 and Fedora 20/21

APC (Alternative PHP Cache) is a free and open source tool to cache PHP codes. 1. Install Dependency Packages for APC yum install php-pear php-devel httpd-devel pcre-devel gcc make -y 2. Install APC using PECL (PHP Extension Community Library) pecl install apc...