1. Home
  2. Help & Troubleshooting
  3. How to modify the PHP timezone setting for your website

How to modify the PHP timezone setting for your website

For shared hosting customers, you cannot modify the servers Global timezone value but you can use the PHP function date_default_timezone_set to set the timezone for your website.

Below is an example of code that sets and checks the timezone:

<?php
date_default_timezone_set("America/Toronto");
echo date_default_timezone_get();
?>

Note:

A list of available PHP timezones can be found here.

Updated on September 4, 2021

Was this article helpful?

Related Articles