Shared hosting

How to set the timezone for a site?

2013-09-10

By default, PHP on shared hosting uses the Europe/Kiev timezone. The server clock itself runs on UTC.

VPS and dedicated servers use the GMT/UTC timezone.

You can change the PHP timezone for all sites on one PHP version, for a single site, or right in the code.

For all sites on one PHP version

  1. Open "WWW" -> "PHP" and select the version.
  2. Open the "php.ini" tab.
  3. Set "Timezone" and click "Save profile".

How to set the timezone for a site?

For one site

Add this to the site's .htaccess file:

php_value date.timezone Europe/Warsaw

In the site code

date_default_timezone_set('Europe/Warsaw');

List of timezones: https://www.php.net/manual/ru/timezones.php