Most PHP applications (eg WordPress) set the required date/time within the application, so that it’s a user configurable option. Prior to PHP 5.4, PHP would default to the server timezone, however PHP 5.4 upwards now default to UTC if no timezone is set. Ideally, these applications should be updated to contain the timezone via the date_default_timezone_set function.
If the application cannot be updated, you can set a default timezone per site within Plesk as detailed below.
- Login to Plesk or the Conetix Control panel, then select the domain you need to set the PHP timezone for.
- Select PHP Settings :
- At the bottom of the page, add the following line into the Additional directives section:
date.timezone = "Australia/Sydney"
A full list of timezones can be found here: PHP Timezones . Your configuration should look like this:
- Click Apply to save the settings.
- Scroll to the top of the PHP Settings page, then select View the phpinfo() page:
- This will open a page displaying all of the configured PHP information. Scroll down to the date section to verify that the timezone has been updated:
- You can now click OK on the PHP Settings page to finalize the settings.