Change Date/Time for CentOS 6

Need to set the data for Central Stabndard Time?

CentOS System Date/Time
PHP Date and Time Global
MySQL Data and Time

The Timezone can been set to MST by running the following:

mv /etc/localtime /etc/localtime.bak
ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime

#Sync with timeserver

service ntpd stop
ntpdate pool.ntp.org
service ntpd start

#Lock the file

chattr +i /etc/localtime

#MySQL uses the system date and time, so it just needed to be restarted to take effect
service mysqld restart

Added date.ini the following file to /etc/php.d/

[date]
date.timezone=America/Chicago

#Apache needs to be restarted afterwards

#service httpd restart

Leave a Comment

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.