← ServerPilot Docs

How to Change the PHP Timezone

This article is about changing the PHP timezone.

If you instead need to update PHP's database of timezone information, see how to update timezonedb.

The default timezone for PHP is UTC regardless of your server's timezone. This is the timezone used by all PHP date/time functions in your scripts.

To change the PHP timezone for an app, create a .user.ini file in the app's public directory with the following contents:

date.timezone = America/Los_Angeles

See PHP's list of supported timezones to find the names of all possible timezones you can use for the date.timezone setting.

For information on changing other PHP settings, see our tutorial on using .user.ini files.

Last updated: November 3, 2020

Launch your first site in 5 minutes