Change timezone on CentOS 7 server
Some time if you have a server(vps, dedicated) in different timezone where you live, the timezone on the server will be EST(in most cases) OR UTC. Changing it back to your timezone is quite easy. 1st let’s backup the current file. Type date
1st to check your time on the server.
sudo mv /etc/localtime /etc/localtime.bak
Now checkout the zoneinfo dir for your region and country. It is located in /usr/share/zoneinfo/. CD to it and type ls
to see the directories/files, go inside region directory for country level.
Now make a symlink to our desired region with country.
sudo ln -s /usr/share/zoneinfo/Asia/Singapore /etc/localtime
The region and country could be different in your case. Now check the date again by typing date.
If you have database server like MySQL/MariaDB. They need to be restarted to take effect.
sudo service mariadb restart
OR
sudo service mysql restart