loader

Change Time Zone with htaccess Print

  • 12

In my server there are some sites from Turkey, some of from England, some of from Germany. I have got timezone problem in that sites. I found easy solution for this. Just add .htaccess this code:


php_value date.timezone "Europe/Istanbul"

or


php_value date.timezone "America/Chicago"

You can test date is change or not


<?php
 echo date('d-m-Y H:i:s');
?>
If htaccess can't solve your problem, add this code to your php

<?php
putenv("TZ=Europe/Istanbul");
?>

Full List of Time Zone
AD Europe/Andorra
AE Asia/Dubai
AF Asia/Kabul
AG America/Antigua
AI America/Anguilla
AL Europe/Tirane
AM Asia/Yerevan
AN America/Curacao
AO Africa/Luanda
AQ Antarctica/McMurdo
AQ Antarctica/South_Pole
AQ Antarctica/Palmer
AQ Antarctica/Mawson
AQ Antarctica/Davis
AQ Antarctica/Casey
AQ Antarctica/DumontDUrville
AR America/Buenos_Aires
AR America/Rosario
AR America/Cordoba
AR America/Jujuy
AR America/Catamarca
AR America/Mendoza
AS Pacific/Pago_Pago
AT Europe/Vienna
AU Australia/Lord_Howe
AU Australia/Hobart
AU Australia/Melbourne
AU Australia/Sydney
AU Australia/Broken_Hill
AU Australia/Brisbane
AU Australia/Lindeman
AU Australia/Adelaide
AU Australia/Darwin
AU Australia/Perth
AW America/Aruba
AZ Asia/Baku
BA Europe/Sarajevo
BB America/Barbados
BD Asia/Dacca
BE Europe/Brussels
BF Africa/Ouagadougou
BG Europe/Sofia
BH Asia/Bahrain
BI Africa/Bujumbura
BJ Africa/Porto-Novo
BM Atlantic/Bermuda
BN Asia/Brunei
BO America/La_Paz
BR America/Noronha
BR America/Belem
BR America/Fortaleza
BR America/Araguaina
BR America/Maceio
BR America/Sao_Paulo
BR America/Cuiaba
BR America/Porto_Velho
BR America/Manaus
BR America/Porto_Acre
BS America/Nassau
BT Asia/Thimbu
BW Africa/Gaborone
BY Europe/Minsk
BZ America/Belize
CA America/St_Johns
CA America/Halifax
CA America/Glace_Bay
CA America/Goose_Bay
CA America/Pangnirtung
CA America/Montreal
CA America/Nipigon
CA America/Thunder_Bay
CA America/Iqaluit
CA America/Winnipeg
CA America/Rainy_River
CA America/Rankin_Inlet
CA America/Regina
CA America/Swift_Current
CA America/Edmonton
CA America/Yellowknife
CA America/Inuvik
CA America/Dawson_Creek
CA America/Vancouver
CA America/Whitehorse
CA America/Dawson
CC Indian/Cocos
CD Africa/Kinshasa
CD Africa/Lubumbashi
CF Africa/Bangui
CG Africa/Brazzaville
CH Europe/Zurich
CI Africa/Abidjan
CK Pacific/Rarotonga
CL America/Santiago
CL Pacific/Easter
CM Africa/Douala
CN Asia/Harbin
CN Asia/Shanghai
CN Asia/Hong_Kong
CN Asia/Chungking
CN Asia/Urumqi
CN Asia/Kashgar
CO America/Bogota
CR America/Costa_Rica
CU America/Havana
CV Atlantic/Cape_Verde
CX Indian/Christmas
CY Asia/Nicosia
CZ Europe/Prague
DE Europe/Berlin
DJ Africa/Djibouti
DK Europe/Copenhagen
DM America/Dominica
DO America/Santo_Domingo
DZ Africa/Algiers
EC America/Guayaquil
EC Pacific/Galapagos
EE Europe/Tallinn
EG Africa/Cairo
EH Africa/El_Aaiun
ER Africa/Asmera
ES Europe/Madrid
ES Africa/Ceuta
ES Atlantic/Canary
ET Africa/Addis_Ababa
FI Europe/Helsinki
FJ Pacific/Fiji
FK Atlantic/Stanley
FM Pacific/Yap
FM Pacific/Truk
FM Pacific/Ponape
FM Pacific/Kosrae
FO Atlantic/Faeroe
FR Europe/Paris
GA Africa/Libreville
GB Europe/London
GB Europe/Belfast
GD America/Grenada
GE Asia/Tbilisi
GF America/Cayenne
GH Africa/Accra
GI Europe/Gibraltar
GL America/Scoresbysund
GL America/Godthab
GL America/Thule
GM Africa/Banjul
GN Africa/Conakry
GP America/Guadeloupe
GQ Africa/Malabo
GR Europe/Athens
GS Atlantic/South_Georgia
GT America/Guatemala
GU Pacific/Guam
GW Africa/Bissau
GY America/Guyana
HN America/Tegucigalpa
HR Europe/Zagreb
HT America/Port-au-Prince
HU Europe/Budapest
ID Asia/Jakarta
ID Asia/Ujung_Pandang
ID Asia/Jayapura
IE Europe/Dublin
IL Asia/Jerusalem
IN Asia/Calcutta
IO Indian/Chagos
IQ Asia/Baghdad
IR Asia/Tehran
IS Atlantic/Reykjavik
IT Europe/Rome
JM America/Jamaica
JO Asia/Amman
JP Asia/Tokyo
KE Africa/Nairobi
KG Asia/Bishkek
KH Asia/Phnom_Penh
KI Pacific/Tarawa
KI Pacific/Enderbury
KI Pacific/Kiritimati
KM Indian/Comoro
KN America/St_Kitts
KP Asia/Pyongyang
KR Asia/Seoul
KW Asia/Kuwait
KY America/Cayman
KZ Asia/Almaty
KZ Asia/Aqtobe
KZ Asia/Aqtau
LA Asia/Vientiane
LB Asia/Beirut
LC America/St_Lucia
LI Europe/Vaduz
LK Asia/Colombo
LR Africa/Monrovia
LS Africa/Maseru
LT Europe/Vilnius
LU Europe/Luxembourg
LV Europe/Riga
LY Africa/Tripoli
MA Africa/Casablanca
MC Europe/Monaco
MD Europe/Chisinau
MG Indian/Antananarivo
MH Pacific/Majuro
MH Pacific/Kwajalein
MK Europe/Skopje
ML Africa/Bamako
ML Africa/Timbuktu
MM Asia/Rangoon
MN Asia/Ulan_Bator
MO Asia/Macao
MP Pacific/Saipan
MQ America/Martinique
MR Africa/Nouakchott
MS America/Montserrat
MT Europe/Malta
MU Indian/Mauritius
MV Indian/Maldives
MW Africa/Blantyre
MX America/Cancun
MX America/Mexico_City
MX America/Mazatlan
MX America/Chihuahua
MX America/Ensenada
MX America/Tijuana
MY Asia/Kuala_Lumpur
MY Asia/Kuching
MZ Africa/Maputo
NA Africa/Windhoek
NC Pacific/Noumea
NE Africa/Niamey
NF Pacific/Norfolk
NG Africa/Lagos
NI America/Managua
NL Europe/Amsterdam
NO Europe/Oslo
NP Asia/Katmandu
NR Pacific/Nauru
NU Pacific/Niue
NZ Pacific/Auckland
NZ Pacific/Chatham
OM Asia/Muscat
PA America/Panama
PE America/Lima
PF Pacific/Tahiti
PF Pacific/Marquesas
PF Pacific/Gambier
PG Pacific/Port_Moresby
PH Asia/Manila
PK Asia/Karachi
PL Europe/Warsaw
PM America/Miquelon
PN Pacific/Pitcairn
PR America/Puerto_Rico
PS Asia/Gaza
PT Europe/Lisbon
PT Atlantic/Madeira
PT Atlantic/Azores
PW Pacific/Palau
PY America/Asuncion
QA Asia/Qatar
RE Indian/Reunion
RO Europe/Bucharest
RU Europe/Kaliningrad
RU Europe/Moscow
RU Europe/Samara
RU Asia/Yekaterinburg
RU Asia/Omsk
RU Asia/Novosibirsk
RU Asia/Krasnoyarsk
RU Asia/Irkutsk
RU Asia/Yakutsk
RU Asia/Vladivostok
RU Asia/Magadan
RU Asia/Kamchatka
RU Asia/Anadyr
RW Africa/Kigali
SA Asia/Riyadh
SB Pacific/Guadalcanal
SC Indian/Mahe
SD Africa/Khartoum
SE Europe/Stockholm
SG Asia/Singapore
SH Atlantic/St_Helena
SI Europe/Ljubljana
SJ Arctic/Longyearbyen
SJ Atlantic/Jan_Mayen
SK Europe/Bratislava
SL Africa/Freetown
SM Europe/San_Marino
SN Africa/Dakar
SO Africa/Mogadishu
SR America/Paramaribo
ST Africa/Sao_Tome
SV America/El_Salvador
SY Asia/Damascus
SZ Africa/Mbabane
TC America/Grand_Turk
TD Africa/Ndjamena
TF Indian/Kerguelen
TG Africa/Lome
TH Asia/Bangkok
TJ Asia/Dushanbe
TK Pacific/Fakaofo
TM Asia/Ashkhabad
TN Africa/Tunis
TO Pacific/Tongatapu
TR Europe/Istanbul
TT America/Port_of_Spain
TV Pacific/Funafuti
TW Asia/Taipei
TZ Africa/Dar_es_Salaam
UA Europe/Kiev
UA Europe/Simferopol
UG Africa/Kampala
UM Pacific/Johnston
UM Pacific/Midway
UM Pacific/Wake
US America/New_York
US America/Detroit
US America/Louisville
US America/Indianapolis
US America/Indiana/Marengo
US America/Indiana/Knox
US America/Indiana/Vevay
US America/Chicago
US America/Menominee
US America/Denver
US America/Boise
US America/Shiprock
US America/Phoenix
US America/Los_Angeles
US America/Anchorage
US America/Juneau
US America/Yakutat
US America/Nome
US America/Adak
US Pacific/Honolulu
UY America/Montevideo
UZ Asia/Samarkand
UZ Asia/Tashkent
VA Europe/Vatican
VC America/St_Vincent
VE America/Caracas
VG America/Tortola
VI America/St_Thomas
VN Asia/Saigon
VU Pacific/Efate
WF Pacific/Wallis
WS Pacific/Apia
YE Asia/Aden
YT Indian/Mayotte
YU Europe/Belgrade
ZA Africa/Johannesburg
ZM Africa/Lusaka
ZW Africa/Harare


Was this answer helpful?

« Back