Category Archives: php time zones

Time Zone, how to change it on shared cpanel servers

You cannot change it, not on a shared server, but it is possible to change it for your account by editing the PHP script or adding a line to the .htaccess file.

You can change the time zone being displayed with a PHP script. (Unfortunately, I cannot tell you where to put this code. You will need to consult with the program developer.) Here are two sample codes:

< ?php putenv("TZ=Europe/Amsterdam"); ?>


< ?php date_default_timezone_set("America/Los_Angeles"); ?>

You can set the timezone in .htaccess as well. (You can create a New File and name it “.htaccess”, or you can edit the existing one. The .htaccess file belongs in /public_html/ – or a subdirectory if for a subdomain or addon domain). Add the line:
SetEnv TZ America/Indianapolis

you can check the list of timezones at