PHP Classes
elePHPant
Icontem

PHP TimeZones: Retrieve or validate world time zones

Recommend this page to a friend!
  Info   View files Documentation   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-02-14 (7 days ago) RSS 2.0 feedStarStarStar 40%Total: 111 This week: 9All time: 9,014 This week: 49Up
Version License PHP version Categories
timezones 0.1Custom (specified...5PHP 5, Time and Date, Geography
Description Author

This is a simple class that can retrieve or validate world time zones.

It can return associative array with the list of all timezones by name and the time offsets relative to UTC.

The class can also validate if a given timezone name is known.

Innovation Award
PHP Programming Innovation award nominee
March 2017
Number 10
The world is divided into regions with different time zones, each with one time difference relative to the UTC time.

This class has the information of all the different time zones. It can validate time zones by name, as well return the time zones and the respective time offset.

Manuel Lemos
  Performance   Level  
Name: Peter Kahl <contact>
Classes: 37 packages by
Country: United Kingdom United Kingdom
Age: ???
All time rank: 53727 in United Kingdom United Kingdom
Week rank: 10 Up1 in United Kingdom United Kingdom Up
Innovation award
Innovation award
Nominee: 22x

Winner: 2x

Details

Time Zones

Downloads License If this project has business value for you then don't hesitate to support me with a small donation.

Array of world time zones with current time offset.

Two alternative time zone libraries available!

I have created two alternative timezone libraries and you should consider using them.

This MySQL-based library is bit more complex, more versatile and more powerful:

https://github.com/peterkahl/TimeZoneCity

The other is array-based and simpler:

https://github.com/peterkahl/time-zone-names

Usage

Generate HTML code for SELECT tag:

use peterkahl\timeZones\timeZones;

echo '<select>'. PHP_EOL;
$zones = timeZones::getZones(true);
foreach ($zones as $code => $descr) {
  echo '  <option value="'. $val[0] .'">(UTC'. $val[2] .') '. $val[3] .'</option>'. PHP_EOL;
}
echo '</select>'. PHP_EOL;

/*
<select>
  <option value="Pacific/Midway">(UTC-11:00) Midway Atoll, United States</option>
  <option value="Pacific/Niue">(UTC-11:00) Niue</option>
  <option value="Pacific/Pago_Pago">(UTC-11:00) Pago Pago, United States</option>
  <option value="America/Adak">(UTC-10:00) Adak, United States</option>
  <option value="Pacific/Honolulu">(UTC-10:00) Honolulu, United States</option>
  <option value="Pacific/Johnston">(UTC-10:00) Johnston Atoll, United States</option>
  <option value="Pacific/Rarotonga">(UTC-10:00) Rarotonga, Cook Islands</option>
  <option value="Pacific/Tahiti">(UTC-10:00) Tahiti, French Polynesia</option>
  <option value="Pacific/Marquesas">(UTC-09:30) Marquesas Islands, French Polynesia</option>
  <option value="America/Anchorage">(UTC-09:00) Anchorage, United States</option>
  <option value="Pacific/Gambier">(UTC-09:00) Gambier Islands, French Polynesia</option>
  <option value="America/Juneau">(UTC-09:00) Juneau, United States</option>
  <option value="America/Nome">(UTC-09:00) Nome, United States</option>
  <option value="America/Sitka">(UTC-09:00) Sitka, United States</option>
  <option value="America/Yakutat">(UTC-09:00) Yakutat, United States</option>
  <option value="America/Dawson">(UTC-08:00) Dawson, Canada</option>
  <option value="America/Los_Angeles">(UTC-08:00) Los Angeles, United States</option>
  <option value="America/Metlakatla">(UTC-08:00) Metlakatla, United States</option>
  <option value="Pacific/Pitcairn">(UTC-08:00) Pitcairn Islands</option>
  <option value="America/Santa_Isabel">(UTC-08:00) Santa Isabel, Mexico</option>
  <option value="America/Tijuana">(UTC-08:00) Tijuana, Mexico</option>
  <option value="America/Vancouver">(UTC-08:00) Vancouver, Canada</option>
  <option value="America/Whitehorse">(UTC-08:00) Whitehorse, Canada</option>
  <option value="America/Boise">(UTC-07:00) Boise, United States</option>
  <option value="America/Cambridge_Bay">(UTC-07:00) Cambridge Bay, Canada</option>
  <option value="America/Chihuahua">(UTC-07:00) Chihuahua City, Mexico</option>
  <option value="America/Creston">(UTC-07:00) Creston, Canada</option>
  <option value="America/Dawson_Creek">(UTC-07:00) Dawson Creek, Canada</option>
  <option value="America/Denver">(UTC-07:00) Denver, United States</option>
  <option value="America/Edmonton">(UTC-07:00) Edmonton, Canada</option>
  <option value="America/Fort_Nelson">(UTC-07:00) Fort Nelson, Canada</option>
  <option value="America/Hermosillo">(UTC-07:00) Hermosillo, Mexico</option>
  <option value="America/Inuvik">(UTC-07:00) Inuvik, Canada</option>
  <option value="America/Mazatlan">(UTC-07:00) Mazatlan, Mexico</option>
  <option value="America/Ojinaga">(UTC-07:00) Ojinaga, Mexico</option>
  <option value="America/Phoenix">(UTC-07:00) Phoenix, United States</option>
  <option value="America/Yellowknife">(UTC-07:00) Yellowknife, Canada</option>
  <option value="America/Bahia_Banderas">(UTC-06:00) Puerto Vallarta, Mexico</option>
  <option value="America/Belize">(UTC-06:00) Belize City, Belize</option>
  <option value="America/North_Dakota/Beulah">(UTC-06:00) Beulah, United States</option>
  <option value="America/North_Dakota/Center">(UTC-06:00) Center, United States</option>
  <option value="America/Chicago">(UTC-06:00) Chicago, United States</option>
  <option value="America/Costa_Rica">(UTC-06:00) San José, Costa Rica</option>
  <option value="America/El_Salvador">(UTC-06:00) San Salvador, El Salvador</option>
  <option value="Pacific/Galapagos">(UTC-06:00) Galápagos Islands, Ecuador</option>
  <option value="America/Guatemala">(UTC-06:00) Guatemala City, Guatemala</option>
  <option value="America/Indiana/Knox">(UTC-06:00) Knox, United States</option>
  <option value="America/Managua">(UTC-06:00) Managua, Nicaragua</option>
  <option value="America/Matamoros">(UTC-06:00) Matamoros, Mexico</option>
  <option value="America/Menominee">(UTC-06:00) Menominee, United States</option>
  <option value="America/Merida">(UTC-06:00) Mérida, Mexico</option>
  <option value="America/Mexico_City">(UTC-06:00) Mexico City, Mexico</option>
  <option value="America/Monterrey">(UTC-06:00) Monterrey, Mexico</option>
  <option value="America/North_Dakota/New_Salem">(UTC-06:00) New Salem, United States</option>
  <option value="America/Rainy_River">(UTC-06:00) Rainy River, Canada</option>
  <option value="America/Rankin_Inlet">(UTC-06:00) Rankin Inlet, Canada</option>
  <option value="America/Regina">(UTC-06:00) Regina, Canada</option>
  <option value="America/Resolute">(UTC-06:00) Resolute, Canada</option>
  <option value="America/Swift_Current">(UTC-06:00) Swift Current, Canada</option>
  <option value="America/Tegucigalpa">(UTC-06:00) Tegucigalpa, Honduras</option>
  <option value="America/Indiana/Tell_City">(UTC-06:00) Tell City, United States</option>
  <option value="America/Winnipeg">(UTC-06:00) Winnipeg, Canada</option>
  <option value="America/Atikokan">(UTC-05:00) Atikokan, Canada</option>
  <option value="America/Bogota">(UTC-05:00) Bogotá, Colombia</option>
  <option value="America/Cancun">(UTC-05:00) Cancún, Mexico</option>
  <option value="America/Cayman">(UTC-05:00) Cayman Islands</option>
  <option value="America/Detroit">(UTC-05:00) Detroit, United States</option>
  <option value="Pacific/Easter">(UTC-05:00) Easter Island, Chile</option>
  <option value="America/Eirunepe">(UTC-05:00) Eirunepé, Brazil</option>
  <option value="America/Guayaquil">(UTC-05:00) Guayaquil, Ecuador</option>
  <option value="America/Havana">(UTC-05:00) Havana, Cuba</option>
  <option value="America/Indiana/Indianapolis">(UTC-05:00) Indianapolis, United States</option>
  <option value="America/Iqaluit">(UTC-05:00) Iqaluit, Canada</option>
  <option value="America/Jamaica">(UTC-05:00) Kingston, Jamaica</option>
  <option value="America/Lima">(UTC-05:00) Lima, Peru</option>
  <option value="America/Kentucky/Louisville">(UTC-05:00) Louisville, United States</option>
  <option value="America/Indiana/Marengo">(UTC-05:00) Marengo, United States</option>
  <option value="America/Kentucky/Monticello">(UTC-05:00) Monticello, United States</option>
  <option value="America/Nassau">(UTC-05:00) Nassau, Bahamas</option>
  <option value="America/New_York">(UTC-05:00) New York, United States</option>
  <option value="America/Nipigon">(UTC-05:00) Nipigon, Canada</option>
  <option value="America/Panama">(UTC-05:00) Panama City, Panama</option>
  <option value="America/Pangnirtung">(UTC-05:00) Pangnirtung, Canada</option>
  <option value="America/Indiana/Petersburg">(UTC-05:00) Petersburg, United States</option>
  <option value="America/Port-au-Prince">(UTC-05:00) Port-au-Prince, Haiti</option>
  <option value="America/Rio_Branco">(UTC-05:00) Rio Branco, Brazil</option>
  <option value="America/Thunder_Bay">(UTC-05:00) Thunder Bay, Canada</option>
  <option value="America/Toronto">(UTC-05:00) Toronto, Canada</option>
  <option value="America/Indiana/Vevay">(UTC-05:00) Vevay, United States</option>
  <option value="America/Indiana/Vincennes">(UTC-05:00) Vincennes, United States</option>
  <option value="America/Indiana/Winamac">(UTC-05:00) Winamac, United States</option>
  <option value="America/Grand_Turk">(UTC-05:00) Grand Turk, Turks and Caicos Islands</option>
  <option value="America/Anguilla">(UTC-04:00) Anguilla</option>
  <option value="America/Antigua">(UTC-04:00) Antigua and Barbuda</option>
  <option value="America/Aruba">(UTC-04:00) Oranjestad, Aruba</option>
  <option value="America/Barbados">(UTC-04:00) Bridgetown, Barbados</option>
  <option value="Atlantic/Bermuda">(UTC-04:00) Bermuda</option>
  <option value="America/Blanc-Sablon">(UTC-04:00) Blanc-Sablon, Canada</option>
  <option value="America/Boa_Vista">(UTC-04:00) Boa Vista, Brazil</option>
  <option value="America/Caracas">(UTC-04:00) Caracas, Venezuela</option>
  <option value="America/Curacao">(UTC-04:00) Willemstad, Curaçao</option>
  <option value="America/Dominica">(UTC-04:00) Roseau, Dominica</option>
  <option value="America/Glace_Bay">(UTC-04:00) Glace Bay, Canada</option>
  <option value="America/Goose_Bay">(UTC-04:00) Goose Bay, Canada</option>
  <option value="America/Grenada">(UTC-04:00) St George's, Grenada</option>
  <option value="America/Guadeloupe">(UTC-04:00) Basse-Terre, Guadeloupe</option>
  <option value="America/Guyana">(UTC-04:00) Georgetown, Guyana</option>
  <option value="America/Halifax">(UTC-04:00) Halifax, Canada</option>
  <option value="America/Kralendijk">(UTC-04:00) Kralendijk, Caribbean Netherlands</option>
  <option value="America/La_Paz">(UTC-04:00) La Paz, Bolivia</option>
  <option value="America/Lower_Princes">(UTC-04:00) Sint Maarten</option>
  <option value="America/Manaus">(UTC-04:00) Manaus, Brazil</option>
  <option value="America/Marigot">(UTC-04:00) Marigot, Saint Martin</option>
  <option value="America/Martinique">(UTC-04:00) Martinique</option>
  <option value="America/Moncton">(UTC-04:00) Moncton, Canada</option>
  <option value="America/Montserrat">(UTC-04:00) Montserrat</option>
  <option value="America/Port_of_Spain">(UTC-04:00) Port of Spain, Trinidad and Tobago</option>
  <option value="America/Porto_Velho">(UTC-04:00) Porto Velho, Brazil</option>
  <option value="America/Puerto_Rico">(UTC-04:00) San Juan, Puerto Rico</option>
  <option value="America/Santo_Domingo">(UTC-04:00) Santo Domingo, Dominican Republic</option>
  <option value="America/St_Barthelemy">(UTC-04:00) Saint Barthélemy</option>
  <option value="America/St_Kitts">(UTC-04:00) Saint Kitts and Nevis</option>
  <option value="America/St_Lucia">(UTC-04:00) Saint Lucia</option>
  <option value="America/St_Thomas">(UTC-04:00) Saint Thomas, U.S. Virgin Islands</option>
  <option value="America/St_Vincent">(UTC-04:00) Saint Vincent and the Grenadines</option>
  <option value="America/Thule">(UTC-04:00) Pituffik, Greenland</option>
  <option value="America/Tortola">(UTC-04:00) Tortola, British Virgin Islands</option>
  <option value="America/St_Johns">(UTC-03:30) St. John's, Canada</option>
  <option value="America/Araguaina">(UTC-03:00) Araguaína, Brazil</option>
  <option value="America/Asuncion">(UTC-03:00) Asunción, Paraguay</option>
  <option value="America/Bahia">(UTC-03:00) Salvador, Brazil</option>
  <option value="America/Belem">(UTC-03:00) Belém, Brazil</option>
  <option value="America/Argentina/Buenos_Aires">(UTC-03:00) Buenos Aires, Argentina</option>
  <option value="America/Campo_Grande">(UTC-03:00) Campo Grande, Brazil</option>
  <option value="America/Argentina/Catamarca">(UTC-03:00) Catamarca, Argentina</option>
  <option value="America/Cayenne">(UTC-03:00) Cayenne, French Guiana</option>
  <option value="America/Argentina/Cordoba">(UTC-03:00) Córdoba, Argentina</option>
  <option value="America/Cuiaba">(UTC-03:00) Cuiabá, Brazil</option>
  <option value="America/Fortaleza">(UTC-03:00) Fortaleza, Brazil</option>
  <option value="America/Argentina/La_Rioja">(UTC-03:00) La Rioja, Argentina</option>
  <option value="America/Maceio">(UTC-03:00) Maceió, Brazil</option>
  <option value="America/Argentina/Mendoza">(UTC-03:00) Mendoza, Argentina</option>
  <option value="America/Miquelon">(UTC-03:00) Miquelon-Langlade, Saint Pierre and Miquelon</option>
  <option value="America/Montevideo">(UTC-03:00) Montevideo, Uruguay</option>
  <option value="America/Godthab">(UTC-03:00) Nuuk, Greenland</option>
  <option value="Antarctica/Palmer">(UTC-03:00) Palmer Station, Antarctica</option>
  <option value="America/Paramaribo">(UTC-03:00) Paramaribo, Suriname</option>
  <option value="America/Recife">(UTC-03:00) Recife, Brazil</option>
  <option value="America/Argentina/Rio_Gallegos">(UTC-03:00) Río Gallegos, Argentina</option>
  <option value="Antarctica/Rothera">(UTC-03:00) Rothera Station, Antarctica</option>
  <option value="America/Argentina/Salta">(UTC-03:00) Salta, Argentina</option>
  <option value="America/Argentina/San_Juan">(UTC-03:00) San Juan, Argentina</option>
  <option value="America/Argentina/San_Luis">(UTC-03:00) San Luis, Argentina</option>
  <option value="America/Argentina/Jujuy">(UTC-03:00) San Salvador de Jujuy, Argentina</option>
  <option value="America/Santarem">(UTC-03:00) Santarém, Brazil</option>
  <option value="America/Santiago">(UTC-03:00) Santiago, Chile</option>
  <option value="America/Argentina/Tucuman">(UTC-03:00) San Miguel de Tucumán, Argentina</option>
  <option value="Atlantic/Stanley">(UTC-03:00) Stanley, Canada</option>
  <option value="America/Argentina/Ushuaia">(UTC-03:00) Ushuaia, Argentina</option>
  <option value="America/Noronha">(UTC-02:00) Fernando de Noronha, Brazil</option>
  <option value="America/Sao_Paulo">(UTC-02:00) São Paulo, Brazil</option>
  <option value="Atlantic/South_Georgia">(UTC-02:00) South Georgia and the South Sandwich Islands</option>
  <option value="Atlantic/Azores">(UTC-01:00) Azores, Portugal</option>
  <option value="Atlantic/Cape_Verde">(UTC-01:00) Cape Verde</option>
  <option value="America/Scoresbysund">(UTC-01:00) Scoresby Sund, Greenland</option>
  <option value="Africa/Abidjan">(UTC+00:00) Abidjan, Côte d'Ivoire</option>
  <option value="Africa/Accra">(UTC+00:00) Accra, Ghana</option>
  <option value="Africa/Bamako">(UTC+00:00) Bamako, Mali</option>
  <option value="Africa/Banjul">(UTC+00:00) Banjul, Gambia</option>
  <option value="Africa/Bissau">(UTC+00:00) Bissau, Guinea-Bissau</option>
  <option value="Atlantic/Canary">(UTC+00:00) Las Palmas de Gran Canaria, Spain</option>
  <option value="Africa/Conakry">(UTC+00:00) Conakry, Guinea</option>
  <option value="Africa/Dakar">(UTC+00:00) Dakar, Senegal</option>
  <option value="Europe/Dublin">(UTC+00:00) Dublin, Ireland</option>
  <option value="Atlantic/Faroe">(UTC+00:00) Faroe Islands</option>
  <option value="Africa/Freetown">(UTC+00:00) Freetown, Sierra Leone</option>
  <option value="Europe/Guernsey">(UTC+00:00) Guernsey</option>
  <option value="Europe/Isle_of_Man">(UTC+00:00) Isle of Man</option>
  <option value="Europe/Jersey">(UTC+00:00) Jersey</option>
  <option value="Europe/Lisbon">(UTC+00:00) Lisbon, Portugal</option>
  <option value="Africa/Lome">(UTC+00:00) Lome, Togo</option>
  <option value="Europe/London">(UTC+00:00) London, United Kingdom</option>
  <option value="Atlantic/Madeira">(UTC+00:00) São Martinho, Portugal</option>
  <option value="Africa/Monrovia">(UTC+00:00) Monrovia, Liberia</option>
  <option value="Africa/Nouakchott">(UTC+00:00) Nouakchott, Mauritania</option>
  <option value="Africa/Ouagadougou">(UTC+00:00) Ouagadougou, Burkina Faso</option>
  <option value="Atlantic/Reykjavik">(UTC+00:00) Reykjavík, Iceland</option>
  <option value="Africa/Sao_Tome">(UTC+00:00) São Tomé and Príncipe</option>
  <option value="Atlantic/St_Helena">(UTC+00:00) Saint Helena, Ascension and Tristan da Cunha</option>
  <option value="Antarctica/Troll">(UTC+00:00) Troll Station, Antarctica</option>
  <option value="Africa/Casablanca">(UTC+01:00) Casablanca, Morocco</option>
  <option value="Africa/El_Aaiun">(UTC+01:00) El-Aaiún, Western Sahara</option>
  <option value="Africa/Algiers">(UTC+01:00) Algiers, Algeria</option>
  <option value="Europe/Amsterdam">(UTC+01:00) Amsterdam, Netherlands</option>
  <option value="Europe/Andorra">(UTC+01:00) Andorra</option>
  <option value="Africa/Bangui">(UTC+01:00) Bangui, Central African Republic</option>
  <option value="Europe/Belgrade">(UTC+01:00) Belgrade, Serbia</option>
  <option value="Europe/Berlin">(UTC+01:00) Berlin, Germany</option>
  <option value="Europe/Bratislava">(UTC+01:00) Bratislava, Slovakia</option>
  <option value="Africa/Brazzaville">(UTC+01:00) Brazzaville, Republic of the Congo</option>
  <option value="Europe/Brussels">(UTC+01:00) Brussels, Belgium</option>
  <option value="Europe/Budapest">(UTC+01:00) Budapest, Hungary</option>
  <option value="Europe/Busingen">(UTC+01:00) Büsingen am Hochrhein, Germany</option>
  <option value="Africa/Ceuta">(UTC+01:00) Ceuta, Spain</option>
  <option value="Europe/Copenhagen">(UTC+01:00) Copenhagen, Denmark</option>
  <option value="Africa/Douala">(UTC+01:00) Douala, Cameroon</option>
  <option value="Europe/Gibraltar">(UTC+01:00) Gibraltar</option>
  <option value="Africa/Kinshasa">(UTC+01:00) Kinshasa, Democratic Republic of the Congo</option>
  <option value="Africa/Lagos">(UTC+01:00) Lagos, Nigeria</option>
  <option value="Africa/Libreville">(UTC+01:00) Libreville, Gabon</option>
  <option value="Europe/Ljubljana">(UTC+01:00) Ljubljana, Slovenia</option>
  <option value="Arctic/Longyearbyen">(UTC+01:00) Longyearbyen, Svalbard and Jan Mayen</option>
  <option value="Africa/Luanda">(UTC+01:00) Luanda, Angola</option>
  <option value="Europe/Luxembourg">(UTC+01:00) Luxembourg City, Luxembourg</option>
  <option value="Europe/Madrid">(UTC+01:00) Madrid, Spain</option>
  <option value="Africa/Malabo">(UTC+01:00) Malabo, Equatorial Guinea</option>
  <option value="Europe/Malta">(UTC+01:00) Valletta, Malta</option>
  <option value="Europe/Monaco">(UTC+01:00) Monaco City, Monaco</option>
  <option value="Africa/Ndjamena">(UTC+01:00) N'Djamena, Chad</option>
  <option value="Africa/Niamey">(UTC+01:00) Niamey, Niger</option>
  <option value="Europe/Oslo">(UTC+01:00) Oslo, Norway</option>
  <option value="Europe/Paris">(UTC+01:00) Paris, France</option>
  <option value="Europe/Podgorica">(UTC+01:00) Podgorica, Montenegro</option>
  <option value="Africa/Porto-Novo">(UTC+01:00) Porto-Novo, Benin</option>
  <option value="Europe/Prague">(UTC+01:00) Prague, Czechia</option>
  <option value="Europe/Rome">(UTC+01:00) Rome, Italy</option>
  <option value="Europe/San_Marino">(UTC+01:00) San Marino</option>
  <option value="Europe/Sarajevo">(UTC+01:00) Sarajevo, Bosnia and Herzegovina</option>
  <option value="Europe/Skopje">(UTC+01:00) Skopje, Macedonia</option>
  <option value="Europe/Stockholm">(UTC+01:00) Stockholm, Sweden</option>
  <option value="Europe/Tirane">(UTC+01:00) Tirane, Albania</option>
  <option value="Africa/Tunis">(UTC+01:00) Tunis, Tunisia</option>
  <option value="Europe/Vaduz">(UTC+01:00) Vaduz, Liechtenstein</option>
  <option value="Europe/Vatican">(UTC+01:00) Vatican City</option>
  <option value="Europe/Vienna">(UTC+01:00) Vienna, Austria</option>
  <option value="Europe/Warsaw">(UTC+01:00) Warsaw, Poland</option>
  <option value="Europe/Zagreb">(UTC+01:00) Zagreb, Croatia</option>
  <option value="Europe/Zurich">(UTC+01:00) Zürich, Switzerland</option>
  <option value="Asia/Amman">(UTC+02:00) Amman, Jordan</option>
  <option value="Europe/Athens">(UTC+02:00) Athens, Greece</option>
  <option value="Asia/Beirut">(UTC+02:00) Beirut, Lebanon</option>
  <option value="Africa/Blantyre">(UTC+02:00) Blantyre, Malawi</option>
  <option value="Europe/Bucharest">(UTC+02:00) Bucharest, Romania</option>
  <option value="Africa/Bujumbura">(UTC+02:00) Bujumbura, Burundi</option>
  <option value="Africa/Cairo">(UTC+02:00) Cairo, Egypt</option>
  <option value="Europe/Chisinau">(UTC+02:00) Chisinau, Moldova</option>
  <option value="Asia/Damascus">(UTC+02:00) Damascus, Syria</option>
  <option value="Africa/Gaborone">(UTC+02:00) Gaborone, Botswana</option>
  <option value="Asia/Gaza">(UTC+02:00) Gaza Strip, Palestine</option>
  <option value="Africa/Harare">(UTC+02:00) Harare, Zimbabwe</option>
  <option value="Asia/Hebron">(UTC+02:00) Hebron, Palestine</option>
  <option value="Europe/Helsinki">(UTC+02:00) Helsinki, Finland</option>
  <option value="Asia/Jerusalem">(UTC+02:00) Jerusalem, Israel</option>
  <option value="Africa/Johannesburg">(UTC+02:00) Johannesburg, South Africa</option>
  <option value="Europe/Kaliningrad">(UTC+02:00) Kaliningrad, Russia</option>
  <option value="Europe/Kiev">(UTC+02:00) Kiev, Ukraine</option>
  <option value="Africa/Kigali">(UTC+02:00) Kigali, Rwanda</option>
  <option value="Africa/Lubumbashi">(UTC+02:00) Lubumbashi, Democratic Republic of the Congo</option>
  <option value="Africa/Lusaka">(UTC+02:00) Lusaka, Zambia</option>
  <option value="Africa/Maputo">(UTC+02:00) Maputo, Mozambique</option>
  <option value="Europe/Mariehamn">(UTC+02:00) Mariehamn, Åland Islands</option>
  <option value="Africa/Maseru">(UTC+02:00) Maseru, Lesotho</option>
  <option value="Asia/Nicosia">(UTC+02:00) Nicosia, Cyprus</option>
  <option value="Africa/Mbabane">(UTC+02:00) Mbabane, Swaziland</option>
  <option value="Europe/Riga">(UTC+02:00) Riga, Latvia</option>
  <option value="Europe/Sofia">(UTC+02:00) Sofia, Bulgaria</option>
  <option value="Europe/Tallinn">(UTC+02:00) Tallinn, Estonia</option>
  <option value="Africa/Tripoli">(UTC+02:00) Tripoli, Libya</option>
  <option value="Europe/Uzhgorod">(UTC+02:00) Uzhgorod, Ukraine</option>
  <option value="Europe/Vilnius">(UTC+02:00) Vilnius, Lithuania</option>
  <option value="Africa/Windhoek">(UTC+02:00) Windhoek, Namibia</option>
  <option value="Europe/Zaporozhye">(UTC+02:00) Zaporizhia, Ukraine</option>
  <option value="Africa/Khartoum">(UTC+02:00) Khartoum, Sudan</option>
  <option value="Africa/Addis_Ababa">(UTC+03:00) Addis Ababa, Ethiopia</option>
  <option value="Asia/Aden">(UTC+03:00) Aden, Yemen</option>
  <option value="Indian/Antananarivo">(UTC+03:00) Antananarivo, Madagascar</option>
  <option value="Africa/Asmara">(UTC+03:00) Asmara, Eritrea</option>
  <option value="Asia/Baghdad">(UTC+03:00) Baghdad, Iraq</option>
  <option value="Asia/Bahrain">(UTC+03:00) Manama, Bahrain</option>
  <option value="Indian/Comoro">(UTC+03:00) Moroni, Comoros</option>
  <option value="Africa/Dar_es_Salaam">(UTC+03:00) Dar es Salaam, Tanzania</option>
  <option value="Africa/Djibouti">(UTC+03:00) Djibouti</option>
  <option value="Europe/Istanbul">(UTC+03:00) Istanbul, Turkey</option>
  <option value="Africa/Juba">(UTC+03:00) Juba, South Sudan</option>
  <option value="Africa/Kampala">(UTC+03:00) Kampala, Uganda</option>
  <option value="Asia/Kuwait">(UTC+03:00) Kuwait City, Kuwait</option>
  <option value="Indian/Mayotte">(UTC+03:00) Mamoudzou, Mayotte</option>
  <option value="Europe/Minsk">(UTC+03:00) Minsk, Belarus</option>
  <option value="Africa/Mogadishu">(UTC+03:00) Mogadishu, Somalia</option>
  <option value="Europe/Moscow">(UTC+03:00) Moscow, Russia</option>
  <option value="Africa/Nairobi">(UTC+03:00) Nairobi, Kenya</option>
  <option value="Asia/Qatar">(UTC+03:00) Qatar</option>
  <option value="Asia/Riyadh">(UTC+03:00) Riyadh, Saudi Arabia</option>
  <option value="Europe/Simferopol">(UTC+03:00) Simferopol, Ukraine</option>
  <option value="Antarctica/Syowa">(UTC+03:00) Syowa Station, Antarctica</option>
  <option value="Asia/Tehran">(UTC+03:30) Tehran, Iran</option>
  <option value="Europe/Volgograd">(UTC+04:00) Volgograd, Russia</option>
  <option value="Asia/Baku">(UTC+04:00) Baku, Azerbaijan</option>
  <option value="Asia/Dubai">(UTC+04:00) Dubai, United Arab Emirates</option>
  <option value="Indian/Mahe">(UTC+04:00) Mahé, Seychelles</option>
  <option value="Indian/Mauritius">(UTC+04:00) Mauritius</option>
  <option value="Asia/Muscat">(UTC+04:00) Muscat, Oman</option>
  <option value="Indian/Reunion">(UTC+04:00) Saint-Denis, Réunion</option>
  <option value="Europe/Samara">(UTC+04:00) Samara, Russia</option>
  <option value="Asia/Tbilisi">(UTC+04:00) Tbilisi, Georgia</option>
  <option value="Asia/Yerevan">(UTC+04:00) Yerevan, Armenia</option>
  <option value="Asia/Kabul">(UTC+04:30) Kabul, Afghanistan</option>
  <option value="Asia/Aqtau">(UTC+05:00) Aktau, Kazakhstan</option>
  <option value="Asia/Aqtobe">(UTC+05:00) Aktobe, Kazakhstan</option>
  <option value="Asia/Ashgabat">(UTC+05:00) Ashgabat, Turkmenistan</option>
  <option value="Asia/Dushanbe">(UTC+05:00) Dushanbe, Tajikistan</option>
  <option value="Asia/Karachi">(UTC+05:00) Karachi, Pakistan</option>
  <option value="Indian/Kerguelen">(UTC+05:00) Kerguelen Islands, French Southern and Antarctic Lands</option>
  <option value="Indian/Maldives">(UTC+05:00) Maldives</option>
  <option value="Antarctica/Mawson">(UTC+05:00) Mawson Station, Antarctica</option>
  <option value="Asia/Oral">(UTC+05:00) Uralsk, Kazakhstan</option>
  <option value="Asia/Samarkand">(UTC+05:00) Samarkand, Uzbekistan</option>
  <option value="Asia/Tashkent">(UTC+05:00) Tashkent, Uzbekistan</option>
  <option value="Asia/Yekaterinburg">(UTC+05:00) Yekaterinburg, Russia</option>
  <option value="Asia/Qyzylorda">(UTC+05:00) Kyzylorda, Kazakhstan</option>
  <option value="Asia/Colombo">(UTC+05:30) Colombo, Sri Lanka</option>
  <option value="Asia/Kolkata">(UTC+05:30) Kolkata, India</option>
  <option value="Asia/Kathmandu">(UTC+05:45) Kathmandu, Nepal</option>
  <option value="Asia/Almaty">(UTC+06:00) Almaty, Kazakhstan</option>
  <option value="Asia/Bishkek">(UTC+06:00) Bishkek, Kyrgyzstan</option>
  <option value="Indian/Chagos">(UTC+06:00) Chagosøerne, British Indian Ocean Territory</option>
  <option value="Asia/Dhaka">(UTC+06:00) Dhaka, Bangladesh</option>
  <option value="Asia/Omsk">(UTC+06:00) Omsk, Russia</option>
  <option value="Asia/Thimphu">(UTC+06:00) Thimphu, Bhutan</option>
  <option value="Asia/Urumqi">(UTC+06:00) Urumqi, China</option>
  <option value="Antarctica/Vostok">(UTC+06:00) Vostok Station, Antarctica</option>
  <option value="Indian/Cocos">(UTC+06:30) Cocos (Keeling) Islands</option>
  <option value="Asia/Rangoon">(UTC+06:30) Yangon, Myanmar</option>
  <option value="Asia/Novosibirsk">(UTC+07:00) Novosibirsk, Russia</option>
  <option value="Asia/Bangkok">(UTC+07:00) Bangkok, Thailand</option>
  <option value="Indian/Christmas">(UTC+07:00) Christmas Island</option>
  <option value="Antarctica/Davis">(UTC+07:00) Davis Station, Antarctica</option>
  <option value="Asia/Ho_Chi_Minh">(UTC+07:00) Ho Chi Minh City, Vietnam</option>
  <option value="Asia/Hovd">(UTC+07:00) Khovd, Mongolia</option>
  <option value="Asia/Jakarta">(UTC+07:00) Jakarta, Indonesia</option>
  <option value="Asia/Krasnoyarsk">(UTC+07:00) Krasnoyarsk, Russia</option>
  <option value="Asia/Novokuznetsk">(UTC+07:00) Novokuznetsk, Russia</option>
  <option value="Asia/Phnom_Penh">(UTC+07:00) Phnom Penh, Cambodia</option>
  <option value="Asia/Pontianak">(UTC+07:00) Pontianak, Indonesia</option>
  <option value="Asia/Vientiane">(UTC+07:00) Vientiane, Laos</option>
  <option value="Asia/Brunei">(UTC+08:00) Brunei</option>
  <option value="Antarctica/Casey">(UTC+08:00) Casey Station, Antarctica</option>
  <option value="Asia/Choibalsan">(UTC+08:00) Choibalsan, Mongolia</option>
  <option value="Asia/Harbin">(UTC+08:00) Harbin, China</option>
  <option value="Asia/Hong_Kong">(UTC+08:00) Hong Kong</option>
  <option value="Asia/Irkutsk">(UTC+08:00) Irkutsk, Russia</option>
  <option value="Asia/Kuala_Lumpur">(UTC+08:00) Kuala Lumpur, Malaysia</option>
  <option value="Asia/Kuching">(UTC+08:00) Kuching, Malaysia</option>
  <option value="Asia/Macau">(UTC+08:00) Macau</option>
  <option value="Asia/Makassar">(UTC+08:00) Makassar, Indonesia</option>
  <option value="Asia/Manila">(UTC+08:00) Manila, Philippines</option>
  <option value="Australia/Perth">(UTC+08:00) Perth, Australia</option>
  <option value="Asia/Shanghai">(UTC+08:00) Shanghai, China</option>
  <option value="Asia/Singapore">(UTC+08:00) Singapore</option>
  <option value="Asia/Taipei">(UTC+08:00) Taipei, Taiwan</option>
  <option value="Asia/Ulaanbaatar">(UTC+08:00) Ulaanbaatar, Mongolia</option>
  <option value="Australia/Eucla">(UTC+08:45) Eucla, Australia</option>
  <option value="Asia/Chita">(UTC+09:00) Chita, Russia</option>
  <option value="Asia/Pyongyang">(UTC+09:00) Pyongyang, North Korea</option>
  <option value="Asia/Dili">(UTC+09:00) Díli, Timor-Leste</option>
  <option value="Asia/Jayapura">(UTC+09:00) Jayapura, Indonesia</option>
  <option value="Asia/Khandyga">(UTC+09:00) Khandyga, Russia</option>
  <option value="Pacific/Palau">(UTC+09:00) Palau</option>
  <option value="Asia/Seoul">(UTC+09:00) Seoul, South Korea</option>
  <option value="Asia/Tokyo">(UTC+09:00) Tokyo, Japan</option>
  <option value="Asia/Yakutsk">(UTC+09:00) Yakutsk, Russia</option>
  <option value="Australia/Darwin">(UTC+09:30) Darwin, Australia</option>
  <option value="Australia/Brisbane">(UTC+10:00) Brisbane, Australia</option>
  <option value="Pacific/Chuuk">(UTC+10:00) Chuuk, Federated States of Micronesia</option>
  <option value="Antarctica/DumontDUrville">(UTC+10:00) Dumont d'Urville Station, Antarctica</option>
  <option value="Pacific/Guam">(UTC+10:00) Guam</option>
  <option value="Australia/Lindeman">(UTC+10:00) Lindeman Island, Australia</option>
  <option value="Pacific/Port_Moresby">(UTC+10:00) Port Moresby, Papua New Guinea</option>
  <option value="Pacific/Saipan">(UTC+10:00) Saipan, Northern Mariana Islands</option>
  <option value="Asia/Ust-Nera">(UTC+10:00) Ust-Nera, Russia</option>
  <option value="Asia/Vladivostok">(UTC+10:00) Vladivostok, Russia</option>
  <option value="Australia/Adelaide">(UTC+10:30) Adelaide, Australia</option>
  <option value="Australia/Broken_Hill">(UTC+10:30) Broken Hill, Australia</option>
  <option value="Asia/Magadan">(UTC+11:00) Magadan, Russia</option>
  <option value="Asia/Sakhalin">(UTC+11:00) Sakhalin, Russia</option>
  <option value="Australia/Lord_Howe">(UTC+11:00) Lord Howe Island, Australia</option>
  <option value="Pacific/Bougainville">(UTC+11:00) Bougainville Island, Papua New Guinea</option>
  <option value="Australia/Currie">(UTC+11:00) Currie, Australia</option>
  <option value="Pacific/Efate">(UTC+11:00) Efate, Vanuatu</option>
  <option value="Pacific/Guadalcanal">(UTC+11:00) Guadalcanal, Solomon Islands</option>
  <option value="Australia/Hobart">(UTC+11:00) Hobart, Australia</option>
  <option value="Pacific/Kosrae">(UTC+11:00) Kosrae, Federated States of Micronesia</option>
  <option value="Antarctica/Macquarie">(UTC+11:00) Macquarie Island, Australia</option>
  <option value="Australia/Melbourne">(UTC+11:00) Melbourne, Australia</option>
  <option value="Pacific/Norfolk">(UTC+11:00) Norfolk Island</option>
  <option value="Pacific/Noumea">(UTC+11:00) Noumea, New Caledonia</option>
  <option value="Pacific/Pohnpei">(UTC+11:00) Pohnpei, Federated States of Micronesia</option>
  <option value="Asia/Srednekolymsk">(UTC+11:00) Srednekolymsk, Russia</option>
  <option value="Australia/Sydney">(UTC+11:00) Sydney, Australia</option>
  <option value="Asia/Anadyr">(UTC+12:00) Anadyr, Russia</option>
  <option value="Pacific/Funafuti">(UTC+12:00) Funafuti, Tuvalu</option>
  <option value="Asia/Kamchatka">(UTC+12:00) Kamchatka Peninsula, Russia</option>
  <option value="Pacific/Kwajalein">(UTC+12:00) Kwajalein Atoll, Marshall Islands</option>
  <option value="Pacific/Majuro">(UTC+12:00) Majuro, Marshall Islands</option>
  <option value="Pacific/Nauru">(UTC+12:00) Nauru</option>
  <option value="Pacific/Tarawa">(UTC+12:00) Tarawa Atoll, Kiribati</option>
  <option value="Pacific/Wake">(UTC+12:00) Wake Island, United States</option>
  <option value="Pacific/Wallis">(UTC+12:00) Wallis Island, Wallis and Futuna</option>
  <option value="Pacific/Fiji">(UTC+12:00) Suva, Fiji</option>
  <option value="Pacific/Auckland">(UTC+13:00) Auckland, New Zealand</option>
  <option value="Pacific/Enderbury">(UTC+13:00) Enderbury Island, Kiribati</option>
  <option value="Pacific/Fakaofo">(UTC+13:00) Fakaofo, Tokelau</option>
  <option value="Antarctica/McMurdo">(UTC+13:00) McMurdo Station, Antarctica</option>
  <option value="Pacific/Tongatapu">(UTC+13:00) Tongatapu, Tonga</option>
  <option value="Pacific/Chatham">(UTC+13:45) Chatham Islands, New Zealand</option>
  <option value="Pacific/Apia">(UTC+14:00) Apia, Samoa</option>
  <option value="Pacific/Kiritimati">(UTC+14:00) Kiritimati, Kiribati</option>
</select>

Exec Time = 17.28 msec
*/

Get information on given time zone:

use peterkahl\timeZones\timeZones;

$temp = timeZones::getInfo('Africa/Sao_Tome');
var_dump($temp);

/*
array(4) {
  [0]=>
  string(15) "Africa/Sao_Tome"
  [1]=>
  int(0)
  [2]=>
  string(6) "+00:00"
  [3]=>
  string(24) "São Tomé and Príncipe"
}
*/

$temp = timeZones::getInfo('Asia/Ulaanbaatar');
var_dump($temp);

/*
array(4) {
  [0]=>
  string(16) "Asia/Ulaanbaatar"
  [1]=>
  int(28800)
  [2]=>
  string(6) "+08:00"
  [3]=>
  string(21) "Ulaanbaatar, Mongolia"
}
*/

  Files folder image Files  
File Role Description
Files folder imagesrc (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file timeZones.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:111
This week:9
All time:9,014
This week:49Up
 User Ratings  
 
 All time
Utility:58%StarStarStar
Consistency:58%StarStarStar
Documentation:58%StarStarStar
Examples:-
Tests:-
Videos:-
Overall:40%StarStarStar
Rank:2945