You can configure PHP setting to use your local time zone by setting the date.timezone directive in php.ini.
How to change 'date.timezone' on shared servers
1. Go to your cPanel account > Files section > File Manager menu:
- Navigate to the root folder of your website (by default, it is public_html for the main domain and yourdomain.com for addon domains). If you don't have the php.ini file yet, feel free to create it using the '+ File' button:
Right-click the file and select Code Edit:
3. Add the following line:
date.timezone = "Place/Your_town"
change Place/Your_town to the preferred time zone
- ClickSave Changes.
5. Next, add an LSPHP directive rule to your .htaccess file. You can learn more about the
LSPHP handler here. Add the following lines to the .htaccess file (.htaccess is a hidden file. To see such files, click Settings in the upper right corner of the File Manager, check Show hidden files (dotfiles), then Save):
Add the following line:
Replace 'USER' with your cPanel username. If your php.ini file is located in a different directory, change the path accordingly:
- Click Save Changes.