In the event you need to localize your time via PHP for your applications/scripts/website, you can make the change easily via your .htaccess file. Please note the servers timezone cannot be changed however. For purposes of this article we'll be using cPanels File Manager, though these changes can be made via SSH or any FTP client (we suggest WinSCP). To change your timezone via .htaccess:
- Login to cPanel for your account, and in the top left finder search for File Manager.
- Select the File Manager icon, and you'll be greeted with a popup. On this dialogue, you'll want to select 'Web Root' for the directory also select 'Show Hidden Files (dotfiles)'.
- Once your File Manager opens, locate your .htaccess file and click it. Once highlighted, select 'Edit' from the top navigation. You will be prompted with another dialogue box, just hit 'Edit' to continue to the editor.
- Now that you're editing your .htaccess, add the following lines to your file:
php_value date.timezone "America/Chicago"
Replace "America/Chicago" with the timezone you wish to use. This will now change the timezone for your applications/sites to the one specified.
- If you need a list of all supported timezones, please reference the following URL: Supported PHP Timezones