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.9.3_1094]
Rating: 10.0/10 (1 vote cast)
How to change your server time zone using .htaccess or php.ini?, 10.0 out of 10 based on 1 rating

, , , , ,

Leave a Reply