Method 1: Set the timezone in cPanel (recommended)
- Log in to cPanel.
- Open MultiPHP INI Editor (or Select PHP Version → Options, depending on your server).
- Select your domain.
- Find the date.timezone setting.
- Enter your timezone identifier, for example
Europe/LondonorAmerica/New_York. - Save.
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):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.