How do I specify a time zone for my website (PHP)?

Andrew Porter
Published: 6 April 2020
Share:

Sometimes, you may need your PHP scripts to work using a specific time zone, for example, if you're serving customers in a certain area of the world.

By default, our platform is set to be Europe/London.

To apply your own timezone, the following can be added to a .user.ini or a php.ini file:

date.timezone=TIMEZONE

In this case, TIMEZONE must be a permitted timezone, as per:

https://www.php.net/manual/en/timezones.php