Adjusting the PHP date.timezone Setting
Introduction
By default, PHP uses the UTC time zone. If you want to use a different default time zone, this article explains how to adjust the time zone globally or on a per-domain basis.
We recommend storing time in UTC so that it can later be displayed based on the user’s current time zone.
All servers, regardless of support level, are also shipped with the UTC time zone by default.
Prerequisites
- Access to the Plesk Control Panel
Adjustment for All Domains
If you want to adjust the PHP time zone globally (for a specific PHP version), click “Tools & Settings” in the left sidebar in Plesk, then select “PHP Settings.”
The following page displays all installed PHP versions. Please select the PHP version for which you want to adjust the time zone.
After making your selection, you’ll need to edit the php.ini file. To do this, click the “php.ini” tab at the top
Now search the php.ini file for the configuration setting date.timezone. To do this, click the text field and then press Ctrl+F or Command+F to open the search function.
Once you’ve found the setting, adjust it to match your desired time zone. You can find a list of all possible time zones directly on the PHP website.
For our example, we’ll use the German time zone Europe/Berlin
To save the changes, click the “OK” button
The time zone is now set globally for this PHP version.
If you want to adjust the time zone for a different PHP version, you must repeat the steps above for the desired PHP version.
Adjusting the Time Zone for a Domain
If you want to adjust the time zone for a single domain, the procedure is slightly different. To do this, click “Websites & Domains” in Plesk and locate the relevant domain. Under “Developer Tools,” select “PHP.”
In the PHP settings, please scroll all the way down to the section titled “Additional Configuration Instructions.” This is where you need to configure the time zone. To do so, enter the following line in the text field: date.timezone = Europe/Berlin
If Berlin is not the desired time zone, you can find a list of all possible time zones here.
Finally, please save the changes by clicking “Apply.” The time zone for that specific domain will then be updated.