Skip to main content
PHP scripts use the server’s default timezone unless told otherwise. If your application shows the wrong times — timestamps a few hours off, scheduled tasks firing at unexpected hours — setting the correct timezone usually fixes it.
  1. Log in to cPanel.
  2. Open MultiPHP INI Editor (or Select PHP Version → Options, depending on your server).
  3. Select your domain.
  4. Find the date.timezone setting.
  5. Enter your timezone identifier, for example Europe/London or America/New_York.
  6. Save.
This applies to all PHP scripts on the domain. You can find the full list of valid timezone identifiers at https://www.php.net/manual/en/timezones.php.

Method 2: Set the timezone in .htaccess

Add this line to the .htaccess file in your document root:

Method 3: Set the timezone in your PHP code

At the top of your script (or in a shared include):
This affects only the script(s) where it runs, which is useful if different parts of an application need different timezones.

Application-level settings

Many applications have their own timezone setting that overrides or complements PHP’s:
  • WordPress: Settings → General → Timezone
  • Laravel: the timezone key in config/app.php
Database timestamps are a separate concern — MySQL has its own timezone handling. If you store times in the database, it’s best practice to store them in UTC and convert for display.

Verifying the change

Create a file containing:
Visit it in your browser to confirm the active timezone and current time, then delete the file.