When working with programs that use php, you may notice that the timezone on the site is off. This is because the timezone is set for the location of your hosting server, either on the East or West coast of the United States. If you prefer to have your timezone set for another locale in the world due to your targeted clientele, you will want to change the timezone in your php.ini file. Below is a quick guide to doing that in your hosting account.
Setting the timezone in your php.ini file
- Log into your cPanel interface.
- Using your File Manager, locate and then open your php.ini file for editing.
- Add the following line of code to top of your php.ini file
date.timezone = "US/Pacific"
- Replace the value US/Pacific with the timezone from the lists found here for your desired timezone.
- Click the Save Changes button found in the upper right corner of the screen.
- Now, you can check your phpinfo.php page to verify the change took place. Below is a before and after of the setting in the php.ini file.