1. Home
  2. Knowledge Base
  3. Website
  4. Website Tips
  5. How to change the timezone for a single PHP file

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=Asia/Singapore”);

You should simply replace “Asia/Singapore” with the desired timezone.

The full list of supported timezones from this URL : https://www.php.net/manual/en/timezones.php.

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support