Knowledge Base Article

How to change the timezone for a single PHP file?

You can set a specific timezone for a PHP script using the following function which should be added to the PHP file:

putenv("TZ=US/Central");

This is just an example. The full list of supported timezones is available here. You should simply replace "US/Central" with the desired timezone.

 

If you wish to change the PHP timezone on a per-folder basis, please check this article for information how to do it.



Rating

Please indicate if this article was helpful for you.

rating :  5.0 from 5
views :  403
votes :  3

Related Articles

Views

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

powered by

Valid XHTML 1.0 Strict Valid CSS!