Changing the PHP timezone via .htaccess

Here we will teach you how to change the PHP time zone setting by using the date.timezone directive in a .htaccess file.

This will have an effect in the folder into which you put the .htaccess file only.

So, you could technically have a different timezone setting for each folder.

Our Servers are all set to the timezone of our current headquarters which is MST.

To change it create or edit the .htaccess file in your website root.

You can do that by using SSH, FTP or our FileManager.

Navigate to the folder where your PHP application is installed in.

Edit or create the file .htaccess (the dot is important).

Add or edit this:

php_value date.timezone 'Region/Zone'

You can find a list of all available Region/Zone options here: