When creating websites, you may need to modify the timezone for Apache/PHP. There are two ways – you can set the timezone in the .hatccess file or in a PHP file (index.php or another file that will be loaded first).
In the .htaccess file use SetEnv TZ <timezone> to set the enviromental value TZ
//examples
SetEnv TZ Asia/Manila
SetEnv TZ America/Fort_Nelson
You can also set here the date.timezone PHP value with php_value date.timezone “<timezone>”
php_value date.timezone "America/Cayenne"
To set the default timezone in a PHP file use the code:
<?php
date_default_timezone_set('America/Denver');
//
?>
You can also set in PHP the enviromental variable TZ
<?php
putenv("TZ=Africa/Accra");
?>
If your host allow the use of .ini file you can set the timezone in such a file
date.timezone = "Africa/Cairo"
Country code | TZ database name | UTC offset ±hh:mm | UTC DST offset ±hh:mm |
CI | Africa/Abidjan | +00:00 | +00:00 |
GH | Africa/Accra | +00:00 | +00:00 |
ET | Africa/Addis_Ababa | +03:00 | +03:00 |
DZ | Africa/Algiers | +01:00 | +01:00 |
ER | Africa/Asmara | +03:00 | +03:00 |
ML | Africa/Bamako | +00:00 | +00:00 |
CF | Africa/Bangui | +01:00 | +01:00 |
GM | Africa/Banjul | +00:00 | +00:00 |
GW | Africa/Bissau | +00:00 | +00:00 |
MW | Africa/Blantyre | +02:00 | +02:00 |
CG | Africa/Brazzaville | +01:00 | +01:00 |
BI | Africa/Bujumbura | +02:00 | +02:00 |
EG | Africa/Cairo | +02:00 | +02:00 |
MA | Africa/Casablanca | +01:00 | +01:00 |
ES | Africa/Ceuta | +01:00 | +02:00 |
GN | Africa/Conakry | +00:00 | +00:00 |
SN | Africa/Dakar | +00:00 | +00:00 |
TZ | Africa/Dar_es_Salaam | +03:00 | +03:00 |
DJ | Africa/Djibouti | +03:00 | +03:00 |
CM | Africa/Douala | +01:00 | +01:00 |
EH | Africa/El_Aaiun | +00:00 | +01:00 |
SL | Africa/Freetown | +00:00 | +00:00 |
BW | Africa/Gaborone | +02:00 | +02:00 |
ZW | Africa/Harare | +02:00 | +02:00 |
ZA | Africa/Johannesburg | +02:00 | +02:00 |
SS | Africa/Juba | +03:00 | +03:00 |
UG | Africa/Kampala | +03:00 | +03:00 |
SD | Africa/Khartoum | +02:00 | +02:00 |
RW | Africa/Kigali | +02:00 | +02:00 |
CD | Africa/Kinshasa | +01:00 | +01:00 |
NG | Africa/Lagos | +01:00 | +01:00 |
GA | Africa/Libreville | +01:00 | +01:00 |
TG | Africa/Lome | +00:00 | +00:00 |
AO | Africa/Luanda | +01:00 | +01:00 |
CD | Africa/Lubumbashi | +02:00 | +02:00 |
ZM | Africa/Lusaka | +02:00 | +02:00 |
GQ | Africa/Malabo | +01:00 | +01:00 |
MZ | Africa/Maputo | +02:00 | +02:00 |
LS | Africa/Maseru | +02:00 | +02:00 |
SZ | Africa/Mbabane | +02:00 | +02:00 |
SO | Africa/Mogadishu | +03:00 | +03:00 |
LR | Africa/Monrovia | +00:00 | +00:00 |
KE | Africa/Nairobi | +03:00 | +03:00 |
TD | Africa/Ndjamena | +01:00 | +01:00 |
NE | Africa/Niamey | +01:00 | +01:00 |
MR | Africa/Nouakchott | +00:00 | +00:00 |
BF | Africa/Ouagadougou | +00:00 | +00:00 |
BJ | Africa/Porto-Novo | +01:00 | +01:00 |
ST | Africa/Sao_Tome | +00:00 | +00:00 |
Africa/Timbuktu | +00:00 | +00:00 | |
LY | Africa/Tripoli | +02:00 | +02:00 |
TN | Africa/Tunis | +01:00 | +01:00 |
NA | Africa/Windhoek | +02:00 | +02:00 |
US | America/Adak | -10:00 | -09:00 |
US | America/Anchorage | -09:00 | -08:00 |
AI | America/Anguilla | -04:00 | -04:00 |
AG | America/Antigua | -04:00 | -04:00 |
BR | America/Araguaina | -03:00 | -03:00 |
AR | America/Argentina/Buenos_Aires | -03:00 | -03:00 |
AR | America/Argentina/Catamarca | -03:00 | -03:00 |
America/Argentina/ComodRivadavia | -03:00 | -03:00 | |
AR | America/Argentina/Cordoba | -03:00 | -03:00 |
AR | America/Argentina/Jujuy | -03:00 | -03:00 |
AR | America/Argentina/La_Rioja | -03:00 | -03:00 |
AR | America/Argentina/Mendoza | -03:00 | -03:00 |
AR | America/Argentina/Rio_Gallegos | -03:00 | -03:00 |
AR | America/Argentina/Salta | -03:00 | -03:00 |
AR | America/Argentina/San_Juan | -03:00 | -03:00 |
AR | America/Argentina/San_Luis | -03:00 | -03:00 |
AR | America/Argentina/Tucuman | -03:00 | -03:00 |
AR | America/Argentina/Ushuaia | -03:00 | -03:00 |
AW | America/Aruba | -04:00 | -04:00 |
PY | America/Asuncion | -04:00 | -03:00 |
CA | America/Atikokan | -05:00 | -05:00 |
America/Atka | -10:00 | -09:00 | |
BR | America/Bahia | -03:00 | -03:00 |
MX | America/Bahia_Banderas | -06:00 | -05:00 |
BB | America/Barbados | -04:00 | -04:00 |
BR | America/Belem | -03:00 | -03:00 |
BZ | America/Belize | -06:00 | -06:00 |
CA | America/Blanc-Sablon | -04:00 | -04:00 |
BR | America/Boa_Vista | -04:00 | -04:00 |
CO | America/Bogota | -05:00 | -05:00 |
US | America/Boise | -07:00 | -06:00 |
America/Buenos_Aires | -03:00 | -03:00 | |
CA | America/Cambridge_Bay | -07:00 | -06:00 |
BR | America/Campo_Grande | -04:00 | -03:00 |
MX | America/Cancun | -05:00 | -05:00 |
VE | America/Caracas | -04:00 | -04:00 |
America/Catamarca | -03:00 | -03:00 | |
GF | America/Cayenne | -03:00 | -03:00 |
KY | America/Cayman | -05:00 | -05:00 |
US | America/Chicago | -06:00 | -05:00 |
MX | America/Chihuahua | -07:00 | -06:00 |
America/Coral_Harbour | -05:00 | -05:00 | |
America/Cordoba | -03:00 | -03:00 | |
CR | America/Costa_Rica | -06:00 | -06:00 |
CA | America/Creston | -07:00 | -07:00 |
BR | America/Cuiaba | -04:00 | -03:00 |
CW | America/Curacao | -04:00 | -04:00 |
GL | America/Danmarkshavn | +00:00 | +00:00 |
CA | America/Dawson | -08:00 | -07:00 |
CA | America/Dawson_Creek | -07:00 | -07:00 |
US | America/Denver | -07:00 | -06:00 |
US | America/Detroit | -05:00 | -04:00 |
DM | America/Dominica | -04:00 | -04:00 |
CA | America/Edmonton | -07:00 | -06:00 |
BR | America/Eirunepe | -05:00 | -05:00 |
SV | America/El_Salvador | -06:00 | -06:00 |
America/Ensenada | -08:00 | -07:00 | |
CA | America/Fort_Nelson | -07:00 | -07:00 |
America/Fort_Wayne | -05:00 | -04:00 | |
BR | America/Fortaleza | -03:00 | -03:00 |
CA | America/Glace_Bay | -04:00 | -03:00 |
GL | America/Godthab | -03:00 | -02:00 |
CA | America/Goose_Bay | -04:00 | -03:00 |
TC | America/Grand_Turk | -05:00 | -04:00 |
GD | America/Grenada | -04:00 | -04:00 |
GP | America/Guadeloupe | -04:00 | -04:00 |
GT | America/Guatemala | -06:00 | -06:00 |
EC | America/Guayaquil | -05:00 | -05:00 |
GY | America/Guyana | -04:00 | -04:00 |
CA | America/Halifax | -04:00 | -03:00 |
CU | America/Havana | -05:00 | -04:00 |
MX | America/Hermosillo | -07:00 | -07:00 |
US | America/Indiana/Indianapolis | -05:00 | -04:00 |
US | America/Indiana/Knox | -06:00 | -05:00 |
US | America/Indiana/Marengo | -05:00 | -04:00 |
US | America/Indiana/Petersburg | -05:00 | -04:00 |
US | America/Indiana/Tell_City | -06:00 | -05:00 |
US | America/Indiana/Vevay | -05:00 | -04:00 |
US | America/Indiana/Vincennes | -05:00 | -04:00 |
US | America/Indiana/Winamac | -05:00 | -04:00 |
America/Indianapolis | -05:00 | -04:00 | |
CA | America/Inuvik | -07:00 | -06:00 |
CA | America/Iqaluit | -05:00 | -04:00 |
JM | America/Jamaica | -05:00 | -05:00 |
America/Jujuy | -03:00 | -03:00 | |
US | America/Juneau | -09:00 | -08:00 |
US | America/Kentucky/Louisville | -05:00 | -04:00 |
US | America/Kentucky/Monticello | -05:00 | -04:00 |
America/Knox_IN | -06:00 | -05:00 | |
BQ | America/Kralendijk | -04:00 | -04:00 |
BO | America/La_Paz | -04:00 | -04:00 |
PE | America/Lima | -05:00 | -05:00 |
US | America/Los_Angeles | -08:00 | -07:00 |
America/Louisville | -05:00 | -04:00 | |
SX | America/Lower_Princes | -04:00 | -04:00 |
BR | America/Maceio | -03:00 | -03:00 |
NI | America/Managua | -06:00 | -06:00 |
BR | America/Manaus | -04:00 | -04:00 |
MF | America/Marigot | -04:00 | -04:00 |
MQ | America/Martinique | -04:00 | -04:00 |
MX | America/Matamoros | -06:00 | -05:00 |
MX | America/Mazatlan | -07:00 | -06:00 |
America/Mendoza | -03:00 | -03:00 | |
US | America/Menominee | -06:00 | -05:00 |
MX | America/Merida | -06:00 | -05:00 |
US | America/Metlakatla | -09:00 | -08:00 |
MX | America/Mexico_City | -06:00 | -05:00 |
PM | America/Miquelon | -03:00 | -02:00 |
CA | America/Moncton | -04:00 | -03:00 |
MX | America/Monterrey | -06:00 | -05:00 |
UY | America/Montevideo | -03:00 | -03:00 |
America/Montreal | -05:00 | -04:00 | |
MS | America/Montserrat | -04:00 | -04:00 |
BS | America/Nassau | -05:00 | -04:00 |
US | America/New_York | -05:00 | -04:00 |
CA | America/Nipigon | -05:00 | -04:00 |
US | America/Nome | -09:00 | -08:00 |
BR | America/Noronha | -02:00 | -02:00 |
US | America/North_Dakota/Beulah | -06:00 | -05:00 |
US | America/North_Dakota/Center | -06:00 | -05:00 |
US | America/North_Dakota/New_Salem | -06:00 | -05:00 |
MX | America/Ojinaga | -07:00 | -06:00 |
PA | America/Panama | -05:00 | -05:00 |
CA | America/Pangnirtung | -05:00 | -04:00 |
SR | America/Paramaribo | -03:00 | -03:00 |
US | America/Phoenix | -07:00 | -07:00 |
TT | America/Port_of_Spain | -04:00 | -04:00 |
HT | America/Port-au-Prince | -05:00 | -04:00 |
America/Porto_Acre | -05:00 | -05:00 | |
BR | America/Porto_Velho | -04:00 | -04:00 |
PR | America/Puerto_Rico | -04:00 | -04:00 |
CL | America/Punta_Arenas | -03:00 | -03:00 |
CA | America/Rainy_River | -06:00 | -05:00 |
CA | America/Rankin_Inlet | -06:00 | -05:00 |
BR | America/Recife | -03:00 | -03:00 |
CA | America/Regina | -06:00 | -06:00 |
CA | America/Resolute | -06:00 | -05:00 |
BR | America/Rio_Branco | -05:00 | -05:00 |
America/Rosario | -03:00 | -03:00 | |
America/Santa_Isabel | -08:00 | -07:00 | |
BR | America/Santarem | -03:00 | -03:00 |
CL | America/Santiago | -04:00 | -03:00 |
DO | America/Santo_Domingo | -04:00 | -04:00 |
BR | America/Sao_Paulo | -03:00 | -03:00 |
GL | America/Scoresbysund | -01:00 | +00:00 |
America/Shiprock | -07:00 | -06:00 | |
US | America/Sitka | -09:00 | -08:00 |
BL | America/St_Barthelemy | -04:00 | -04:00 |
CA | America/St_Johns | -03:30 | -02:30 |
KN | America/St_Kitts | -04:00 | -04:00 |
LC | America/St_Lucia | -04:00 | -04:00 |
VI | America/St_Thomas | -04:00 | -04:00 |
VC | America/St_Vincent | -04:00 | -04:00 |
CA | America/Swift_Current | -06:00 | -06:00 |
HN | America/Tegucigalpa | -06:00 | -06:00 |
GL | America/Thule | -04:00 | -03:00 |
CA | America/Thunder_Bay | -05:00 | -04:00 |
MX | America/Tijuana | -08:00 | -07:00 |
CA | America/Toronto | -05:00 | -04:00 |
VG | America/Tortola | -04:00 | -04:00 |
CA | America/Vancouver | -08:00 | -07:00 |
America/Virgin | -04:00 | -04:00 | |
CA | America/Whitehorse | -08:00 | -07:00 |
CA | America/Winnipeg | -06:00 | -05:00 |
US | America/Yakutat | -09:00 | -08:00 |
CA | America/Yellowknife | -07:00 | -06:00 |
AQ | Antarctica/Casey | +11:00 | +11:00 |
AQ | Antarctica/Davis | +07:00 | +07:00 |
AQ | Antarctica/DumontDUrville | +10:00 | +10:00 |
AU | Antarctica/Macquarie | +11:00 | +11:00 |
AQ | Antarctica/Mawson | +05:00 | +05:00 |
AQ | Antarctica/McMurdo | +12:00 | +13:00 |
AQ | Antarctica/Palmer | -03:00 | -03:00 |
AQ | Antarctica/Rothera | -03:00 | -03:00 |
Antarctica/South_Pole | +12:00 | +13:00 | |
AQ | Antarctica/Syowa | +03:00 | +03:00 |
AQ | Antarctica/Troll | +00:00 | +02:00 |
AQ | Antarctica/Vostok | +06:00 | +06:00 |
SJ | Arctic/Longyearbyen | +01:00 | +02:00 |
YE | Asia/Aden | +03:00 | +03:00 |
KZ | Asia/Almaty | +06:00 | +06:00 |
JO | Asia/Amman | +02:00 | +03:00 |
RU | Asia/Anadyr | +12:00 | +12:00 |
KZ | Asia/Aqtau | +05:00 | +05:00 |
KZ | Asia/Aqtobe | +05:00 | +05:00 |
TM | Asia/Ashgabat | +05:00 | +05:00 |
Asia/Ashkhabad | +05:00 | +05:00 | |
KZ | Asia/Atyrau | +05:00 | +05:00 |
IQ | Asia/Baghdad | +03:00 | +03:00 |
BH | Asia/Bahrain | +03:00 | +03:00 |
AZ | Asia/Baku | +04:00 | +04:00 |
TH | Asia/Bangkok | +07:00 | +07:00 |
RU | Asia/Barnaul | +07:00 | +07:00 |
LB | Asia/Beirut | +02:00 | +03:00 |
KG | Asia/Bishkek | +06:00 | +06:00 |
BN | Asia/Brunei | +08:00 | +08:00 |
Asia/Calcutta | +05:30 | +05:30 | |
RU | Asia/Chita | +09:00 | +09:00 |
MN | Asia/Choibalsan | +08:00 | +08:00 |
Asia/Chongqing | +08:00 | +08:00 | |
Asia/Chungking | +08:00 | +08:00 | |
LK | Asia/Colombo | +05:30 | +05:30 |
Asia/Dacca | +06:00 | +06:00 | |
SY | Asia/Damascus | +02:00 | +03:00 |
BD | Asia/Dhaka | +06:00 | +06:00 |
TL | Asia/Dili | +09:00 | +09:00 |
AE | Asia/Dubai | +04:00 | +04:00 |
TJ | Asia/Dushanbe | +05:00 | +05:00 |
CY | Asia/Famagusta | +02:00 | +02:00 |
PS | Asia/Gaza | +02:00 | +03:00 |
Asia/Harbin | +08:00 | +08:00 | |
PS | Asia/Hebron | +02:00 | +03:00 |
VN | Asia/Ho_Chi_Minh | +07:00 | +07:00 |
HK | Asia/Hong_Kong | +08:00 | +08:00 |
MN | Asia/Hovd | +07:00 | +07:00 |
RU | Asia/Irkutsk | +08:00 | +08:00 |
Asia/Istanbul | +03:00 | +03:00 | |
ID | Asia/Jakarta | +07:00 | +07:00 |
ID | Asia/Jayapura | +09:00 | +09:00 |
IL | Asia/Jerusalem | +02:00 | +03:00 |
AF | Asia/Kabul | +04:30 | +04:30 |
RU | Asia/Kamchatka | +12:00 | +12:00 |
PK | Asia/Karachi | +05:00 | +05:00 |
Asia/Kashgar | +06:00 | +06:00 | |
NP | Asia/Kathmandu | +05:45 | +05:45 |
Asia/Katmandu | +05:45 | +05:45 | |
RU | Asia/Khandyga | +09:00 | +09:00 |
IN | Asia/Kolkata | +05:30 | +05:30 |
RU | Asia/Krasnoyarsk | +07:00 | +07:00 |
MY | Asia/Kuala_Lumpur | +08:00 | +08:00 |
MY | Asia/Kuching | +08:00 | +08:00 |
KW | Asia/Kuwait | +03:00 | +03:00 |
Asia/Macao | +08:00 | +08:00 | |
MO | Asia/Macau | +08:00 | +08:00 |
RU | Asia/Magadan | +11:00 | +11:00 |
ID | Asia/Makassar | +08:00 | +08:00 |
PH | Asia/Manila | +08:00 | +08:00 |
OM | Asia/Muscat | +04:00 | +04:00 |
RU | Asia/Novokuznetsk | +07:00 | +07:00 |
RU | Asia/Novosibirsk | +07:00 | +07:00 |
RU | Asia/Omsk | +06:00 | +06:00 |
KZ | Asia/Oral | +05:00 | +05:00 |
KH | Asia/Phnom_Penh | +07:00 | +07:00 |
ID | Asia/Pontianak | +07:00 | +07:00 |
KP | Asia/Pyongyang | +09:00 | +09:00 |
QA | Asia/Qatar | +03:00 | +03:00 |
KZ | Asia/Qyzylorda | +05:00 | +05:00 |
MM | Asia/Rangoon | +06:30 | +06:30 |
SA | Asia/Riyadh | +03:00 | +03:00 |
Asia/Saigon | +07:00 | +07:00 | |
RU | Asia/Sakhalin | +11:00 | +11:00 |
UZ | Asia/Samarkand | +05:00 | +05:00 |
KR | Asia/Seoul | +09:00 | +09:00 |
CN | Asia/Shanghai | +08:00 | +08:00 |
SG | Asia/Singapore | +08:00 | +08:00 |
RU | Asia/Srednekolymsk | +11:00 | +11:00 |
TW | Asia/Taipei | +08:00 | +08:00 |
UZ | Asia/Tashkent | +05:00 | +05:00 |
GE | Asia/Tbilisi | +04:00 | +04:00 |
IR | Asia/Tehran | +03:30 | +04:30 |
Asia/Tel_Aviv | +02:00 | +03:00 | |
Asia/Thimbu | +06:00 | +06:00 | |
BT | Asia/Thimphu | +06:00 | +06:00 |
JP | Asia/Tokyo | +09:00 | +09:00 |
RU | Asia/Tomsk | +07:00 | +07:00 |
Asia/Ujung_Pandang | +08:00 | +08:00 | |
MN | Asia/Ulaanbaatar | +08:00 | +08:00 |
Asia/Ulan_Bator | +08:00 | +08:00 | |
CN | Asia/Urumqi | +06:00 | +06:00 |
RU | Asia/Ust-Nera | +10:00 | +10:00 |
LA | Asia/Vientiane | +07:00 | +07:00 |
RU | Asia/Vladivostok | +10:00 | +10:00 |
RU | Asia/Yakutsk | +09:00 | +09:00 |
MM | Asia/Yangon | +06:30 | +06:30 |
RU | Asia/Yekaterinburg | +05:00 | +05:00 |
AM | Asia/Yerevan | +04:00 | +04:00 |
PT | Atlantic/Azores | -01:00 | +00:00 |
BM | Atlantic/Bermuda | -04:00 | -03:00 |
ES | Atlantic/Canary | +00:00 | +01:00 |
CV | Atlantic/Cape_Verde | -01:00 | -01:00 |
Atlantic/Faeroe | +00:00 | +01:00 | |
FO | Atlantic/Faroe | +00:00 | +01:00 |
Atlantic/Jan_Mayen | +01:00 | +02:00 | |
PT | Atlantic/Madeira | +00:00 | +01:00 |
IS | Atlantic/Reykjavik | +00:00 | +00:00 |
GS | Atlantic/South_Georgia | -02:00 | -02:00 |
SH | Atlantic/St_Helena | +00:00 | +00:00 |
FK | Atlantic/Stanley | -03:00 | -03:00 |
AU | Australia/Adelaide | +09:30 | +10:30 |
AU | Australia/Brisbane | +10:00 | +10:00 |
AU | Australia/Broken_Hill | +09:30 | +10:30 |
Australia/Canberra | +10:00 | +11:00 | |
AU | Australia/Currie | +10:00 | +11:00 |
AU | Australia/Darwin | +09:30 | +09:30 |
AU | Australia/Eucla | +08:45 | +08:45 |
AU | Australia/Hobart | +10:00 | +11:00 |
AU | Australia/Lindeman | +10:00 | +10:00 |
AU | Australia/Lord_Howe | +10:30 | +11:00 |
AU | Australia/Melbourne | +10:00 | +11:00 |
AU | Australia/Perth | +08:00 | +08:00 |
AU | Australia/Sydney | +10:00 | +11:00 |