Server timezone configuration
How to set and change the timezone on your VPS or dedicated server.
Getting the timezone right isn't just a housekeeping detail — it directly affects your logs, cron jobs, email delivery, database timestamps, and caching behavior. A mismatched timezone can cause subtle bugs that are genuinely painful to track down.
1. Setting the timezone for PHP
Option A — via .htaccess
Drop this line into the .htaccess file in your site's root directory:
php_value date.timezone "Europe/Moscow"
Swap Europe/Moscow for whatever timezone fits your setup.
Option B — via php.ini
Open your php.ini (either through your control panel or over SSH) and add or update the following line:
date.timezone = "Europe/Moscow"
Again, replace Europe/Moscow as needed. Once you've saved the file, restart PHP-FPM or your web server for the change to take effect.
The full list of supported timezone identifiers is available in the official PHP documentation.
Our products and services
2. Setting the system-wide timezone (Ubuntu 20.04 / 22.04 / 24.04)
For server-level timezone changes, timedatectl is your go-to tool.
- Check what timezone is currently set:
timedatectl status
- Browse the list of available timezones:
timedatectl list-timezones
Narrow it down with grep if you know what you're looking for:
timedatectl list-timezones | grep Moscow
- Apply your timezone of choice:
sudo timedatectl set-timezone Europe/Moscow
- Confirm the change took effect:
timedatectl status
Or just check the system date:
date
A few things worth knowing
- If you're running cPanel, aaPanel, or CloudPanel, it's often easier to set the PHP timezone directly through the panel's UI — look for MultiPHP Manager or the PHP configuration section.
- For Laravel, Symfony, and most other frameworks, you'll also need to set the timezone in your app's own config file — typically
config/app.php. - Here's the full reference list of timezone identifiers you can use:
Africa/Cairo
Africa/Casablanca
Africa/Harare
Africa/Monrovia
Africa/Nairobi
America/Bogota
America/Buenos_Aires
America/Caracas
America/Chihuahua
America/La_Paz
America/Lima
America/Mazatlan
America/Mexico_City
America/Monterrey
America/Santiago
America/Tijuana
Asia/Almaty
Asia/Baghdad
Asia/Baku
Asia/Bangkok
Asia/Chongqing
Asia/Dhaka
Asia/Hong_Kong
Asia/Irkutsk
Asia/Jakarta
Asia/Jerusalem
Asia/Kabul
Asia/Karachi
Asia/Kathmandu
Asia/Kolkata
Asia/Krasnoyarsk
Asia/Kuala_Lumpur
Asia/Kuwait
Asia/Magadan
Asia/Muscat
Asia/Novosibirsk
Asia/Riyadh
Asia/Seoul
Asia/Singapore
Asia/Taipei
Asia/Tashkent
Asia/Tbilisi
Asia/Tehran
Asia/Tokyo
Asia/Ulaanbaatar
Asia/Urumqi
Asia/Vladivostok
Asia/Yakutsk
Asia/Yekaterinburg
Asia/Yerevan
Atlantic/Azores
Atlantic/Cape_Verde
Atlantic/Stanley
Australia/Adelaide
Australia/Brisbane
Australia/Canberra
Australia/Darwin
Australia/Hobart
Australia/Melbourne
Australia/Perth
Australia/Sydney
Canada/Atlantic
Canada/Newfoundland
Canada/Saskatchewan
Europe/Amsterdam
Europe/Athens
Europe/Belgrade
Europe/Berlin
Europe/Bratislava
Europe/Brussels
Europe/Bucharest
Europe/Budapest
Europe/Copenhagen
Europe/Dublin
Europe/Helsinki
Europe/Istanbul
Europe/Kiev
Europe/Lisbon
Europe/Ljubljana
Europe/London
Europe/Madrid
Europe/Minsk
Europe/Moscow
Europe/Paris
Europe/Prague
Europe/Riga
Europe/Rome
Europe/Sarajevo
Europe/Skopje
Europe/Sofia
Europe/Stockholm
Europe/Tallinn
Europe/Vienna
Europe/Vilnius
Europe/Volgograd
Europe/Warsaw
Europe/Zagreb
Greenland
Pacific/Auckland
Pacific/Fiji
Pacific/Guam
Pacific/Midway
Pacific/Port_Moresby
US/Alaska
US/Arizona
US/Central
US/Eastern
US/East-Indiana
US/Hawaii
US/Mountain
US/Pacific
US/Samoa
Help
If you have any questions or need assistance, please contact us through the ticket system — we're always here to help!