Select Timezone to get current date and time using different formats
PHP Tutorials Date & Time Select Timezone to get current date and time using different formats Work with named timezones Use a valid IANA timezone identifier such as Asia/Kolkata or America/New_York. DateTimeImmutable keeps timezone conversion explicit and avoids changing the original object.
$utc = new DateTimeImmutable ('now' , new DateTimeZone ('UTC' ));
$india = $utc->setTimezone (new DateTimeZone ('Asia/Kolkata' ));
echo $india->format ('Y-m-d H:i:s T' );This current example appears first; the detailed examples below are retained and modernized for comparison and additional use cases.
(GMT-11:00) Midway Island (GMT-11:00) Samoa (GMT-10:00) Hawaii (GMT-09:00) Alaska (GMT-08:00) Pacific Time (US & Canada) (GMT-08:00) Tijuana (GMT-07:00) Arizona (GMT-07:00) Mountain Time (US & Canada) (GMT-07:00) Chihuahua (GMT-07:00) Mazatlan (GMT-06:00) Mexico City (GMT-06:00) Monterrey (GMT-06:00) Saskatchewan (GMT-06:00) Central Time (US & Canada) (GMT-05:00) Eastern Time (US & Canada) (GMT-05:00) Indiana (East) (GMT-05:00) Bogota (GMT-05:00) Lima (GMT-04:30) Caracas (GMT-04:00) Atlantic Time (Canada) (GMT-04:00) La Paz (GMT-04:00) Santiago (GMT-03:30) Newfoundland (GMT-03:00) Buenos Aires (GMT-02:00) Stanley (GMT-01:00) Azores (GMT-01:00) Cape Verde Is. (GMT) Casablanca (GMT) Dublin (GMT) Lisbon (GMT) London (GMT) Monrovia (GMT+01:00) Amsterdam (GMT+01:00) Belgrade (GMT+01:00) Berlin (GMT+01:00) Bratislava (GMT+01:00) Brussels (GMT+01:00) Budapest (GMT+01:00) Copenhagen (GMT+01:00) Ljubljana (GMT+01:00) Madrid (GMT+01:00) Paris (GMT+01:00) Prague (GMT+01:00) Rome (GMT+01:00) Sarajevo (GMT+01:00) Skopje (GMT+01:00) Stockholm (GMT+01:00) Vienna (GMT+01:00) Warsaw (GMT+01:00) Zagreb (GMT+02:00) Athens (GMT+02:00) Bucharest (GMT+02:00) Cairo (GMT+02:00) Harare (GMT+02:00) Helsinki (GMT+02:00) Istanbul (GMT+02:00) Jerusalem (GMT+02:00) Kyiv (GMT+02:00) Minsk (GMT+02:00) Riga (GMT+02:00) Sofia (GMT+02:00) Tallinn (GMT+02:00) Vilnius (GMT+03:00) Baghdad (GMT+03:00) Kuwait (GMT+03:00) Nairobi (GMT+03:00) Riyadh (GMT+03:00) Moscow (GMT+03:30) Tehran (GMT+04:00) Baku (GMT+04:00) Volgograd (GMT+04:00) Muscat (GMT+04:00) Tbilisi (GMT+04:00) Yerevan (GMT+04:30) Kabul (GMT+05:00) Karachi (GMT+05:00) Tashkent (GMT+05:30) Kolkata (GMT+05:45) Kathmandu (GMT+06:00) Ekaterinburg (GMT+06:00) Almaty (GMT+06:00) Dhaka (GMT+07:00) Novosibirsk (GMT+07:00) Bangkok (GMT+07:00) Jakarta (GMT+08:00) Krasnoyarsk (GMT+08:00) Chongqing (GMT+08:00) Hong Kong (GMT+08:00) Kuala Lumpur (GMT+08:00) Perth (GMT+08:00) Singapore (GMT+08:00) Taipei (GMT+08:00) Ulaan Bataar (GMT+08:00) Urumqi (GMT+09:00) Irkutsk (GMT+09:00) Seoul (GMT+09:00) Tokyo (GMT+09:30) Adelaide (GMT+09:30) Darwin (GMT+10:00) Yakutsk (GMT+10:00) Brisbane (GMT+10:00) Canberra (GMT+10:00) Guam (GMT+10:00) Hobart (GMT+10:00) Melbourne (GMT+10:00) Port Moresby (GMT+10:00) Sydney (GMT+11:00) Vladivostok (GMT+12:00) Magadan (GMT+12:00) Auckland (GMT+12:00) Fiji
Author & Instructor at
plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery,
and web development at plus2net. The tutorials focus on clear explanations, working
examples, and code that readers can test and adapt while learning.
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com