How to change the PHP time zone using php.ini
PHP scripts usually follow your hosting server’s time zone. If you are in a different time zone, you can easily change this by adding a few codes in the php.ini file.
To change the PHP time zone, follow the steps below:
- Click on My Account at the top of this page.
- Select Hosting Manager from the drop-down menu.
- Enter your username and password and click Log In.
- On the Home page, click Files or the [ v ] arrow button on the right side, then click File Manager.
- Select Web Root (public_html/www) and click Go.
- Find the php.ini file.
- Click php.ini file, then select Edit button on the upper part of the page.
You may also right-click php.ini, then select Edit.
- A text editor popup will display, just click Edit.
- Add the following code at the top of your php.ini file.
date.timezone = "US/Central"
- Replace US/Central to your preferred time zone. The location you set determines the time that displays in your PHP scripts.
- Click Save Changes to update file.
Congratulations! You just changed your time zone for PHP.
If you want to know how to make php.ini recursive in the .htaccess, click here.
If you want to know how to use different PHP versions, click here.
If you want to know how to change your PHP version in cPanel Hosting, click here.
Fantastic...Thank you for your feedback =)
Sorry... Please submit a support ticket or try another search.
- How to change your PHP version in cPanel Hosting
- How to make the php.ini recursive in the .htaccess
- How to use different PHP versions
- How to connect my domain to Web Hosting
- How to increase PHP memory limit