How to change your server time zone using .htaccess or php.ini?

If you are hosting in a different time zone and would like to change the server’s time zone please do the following:

If you have PHP running as a CGI module

  • Check if your cgi folder or root folder has a file called php.ini, if no, then use your notepad to create one and have it uploaded to your root/cgi folder
  • add “date.timezone = America/New_York” (without quotes) to your php.ini then save the file

If you have PHP running as an apache module

  • Check if your root folder has a file called .htaccess, if no, then use your notepad to create one and have it uploaded to your root folder
  • add “SetEnv TZ America/Los_Angeles” (without quotes) to your .htaccess then save the file

Please change America/New_York or America/Los_Angeles to your specific time zone. To see the list of the time zones, please click http://www.php.net/manual/en/timezones.php

Bookmark and Share
VN:F [1.8.0_1031]
Rating: 0.0/10 (0 votes cast)

Tags: , , , , ,

Leave a Reply