Knowledge Base Article

How to change the date.timezone value in PHP?

If your PHP scripts do not show the correct time, the reason is that most probably your hosting server is in a different timezone. This can be easily resolved by changing a setting in PHP called date.timezone.

 

Depending on your location you can set a specific date.timezone value in PHP using the following option which should be added to your local php.ini file:

 

date.timezone = "US/Central"

 

The above example assumes you'd like to set the timezone for your PHP scripts to US/Central. The full list of supported time zones is available here and you should simply replace "US/Central" with the desired timezone.

 

In this article you can find additional information on how to change PHP values using the php.ini file.

 

Problems like this and much harder ones are easily solved by Siteground Technical Support. If you are not already our client, take a look at our web hosting features.



Rating

Please indicate if this article was helpful for you.

rating :  4.7 from 5
views :  40761
votes :  130

Related Articles

Views

Haven't found what you are looking for? Suggest an article HERE.

powered by

Valid XHTML 1.0 Strict Valid CSS!