Linux 4 All

Best Linux tricks source

Posts in the date category

In order to change the system timezone, there are 6 simple steps you need to follow:

1. Edit /etc/sysconfig/clock. It’s up to you if you’d like UTC to be false or true.

ZONE="Europe/London"
UTC=false

2. Edit /etc/php.ini

date.timezone = Europe/London

3. Update system time. If you are running it on a cloud server, second command is not required.

tzdata-update
hwclock --systohc

4. Restart all effected services, including MySQL if necessary.

service crond restart
service rsyslog restart
service syslog restart
service httpd restart
service mysqld restart

5. Restart NTP

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

6. Run date to confirm date was changed on your server.