.NET中的时区缩写

时间:2016-03-22 18:33:39

标签: .net datetime

我还没有能够为.NET(我称之为#34; Windows")时区格式样式的时区缩写找到一个很好的信息来源。 PHP在列出许多时区方面表现出色,通过date_format('T'),您可以快速发现时区的良好缩写。为了清楚起见,我的目标不是找到时区的本地化版本,只是缩写,就像它出现在英语中一样。我的用例不需要偏移信息或其他任何东西,但你可以使用PHP时区信息轻松获得它。

我只想在查找表中使用数据列,这样我就可以将显示的时区缩写(反映DST)与它们关联起来,这样我就不必使用第三方时区库了。

1 个答案:

答案 0 :(得分:1)

+---------------------------------+--------------------------------------------------------------+----------+----------+-----------------------+
| Name                            | Display                                                      | Daylight | Standard | PHP Zone              |
+---------------------------------+--------------------------------------------------------------+----------+----------+-----------------------+
| Morocco Standard Time           | (UTC) Casablanca                                             | WEST     | WET      | Africa/Casablanca     |
| GMT Standard Time               | (UTC) Dublin, Edinburgh, Lisbon, London                      | BST      | GMT      | Europe/London         |
| Greenwich Standard Time         | (UTC) Monrovia, Reykjavik                                    | GMT      | GMT      | Atlantic/Reykjavik    |
| W. Europe Standard Time         | (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna | CEST     | CET      | Europe/Berlin         |
| Romance Standard Time           | (UTC+01:00) Brussels, Copenhagen, Madrid, Paris              | CEST     | CET      | Europe/Paris          |
| Central European Standard Time  | (UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb                 | CEST     | CET      | Europe/Sarajevo       |
| W. Central Africa Standard Time | (UTC+01:00) West Central Africa                              | WAT      | WAT      | Africa/Kinshasa       |
| Namibia Standard Time           | (UTC+01:00) Windhoek                                         | WAST     | WAT      | Africa/Windhoek       |
| Jordan Daylight Time            | (UTC+02:00) Amman                                            | EEST     | EET      | Asia/Amman            |
| GTB Standard Time               | (UTC+02:00) Athens, Bucharest                                | EEST     | EET      | Europe/Bucharest      |
| Middle East Standard Time       | (UTC+02:00) Beirut                                           | EEST     | EET      | Asia/Beirut           |
| Egypt Standard Time             | (UTC+02:00) Cairo                                            | EET      | EET      | Africa/Cairo          |
| Syria Standard Time             | (UTC+02:00) Damascus                                         | EEST     | EET      | Asia/Damascus         |
| E. Europe Standard Time         | (UTC+02:00) E. Europe                                        | EEST     | EET      | Europe/Helsinki       |
| South Africa Standard Time      | (UTC+02:00) Harare, Pretoria                                 | CAT      | CAT      | Africa/Harare         |
| FLE Standard Time               | (UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius    | EEST     | EET      | Europe/Riga           |
| Turkey Standard Time            | (UTC+02:00) Istanbul                                         | EEST     | EET      | Europe/Istanbul       |
| Israel Standard Time            | (UTC+02:00) Jerusalem                                        | IDT      | IST      | Asia/Jerusalem        |
| Kaliningrad Standard Time       | (UTC+02:00) Kaliningrad (RTZ 1)                              | FET      | EET      | Europe/Kaliningrad    |
| Libya Standard Time             | (UTC+02:00) Tripoli                                          | EET      | EET      | Africa/Tripoli        |
| Arabic Standard Time            | (UTC+03:00) Baghdad                                          | AST      | AST      | Asia/Baghdad          |
| Arab Standard Time              | (UTC+03:00) Kuwait, Riyadh                                   | AST      | AST      | Asia/Kuwait           |
| Belarus Standard Time           | (UTC+03:00) Minsk                                            | FET      | EET      | Europe/Minsk          |
| Russian Standard Time           | (UTC+03:00) Moscow, St. Petersburg, Volgograd (RTZ 2)        | MSK      | MSK      | Europe/Moscow         |
| E. Africa Standard Time         | (UTC+03:00) Nairobi                                          | EAT      | EAT      | Africa/Nairobi        |
| Iran Standard Time              | (UTC+03:30) Tehran                                           | IRDT     | IRST     | Asia/Tehran           |
| Arabian Standard Time           | (UTC+04:00) Abu Dhabi, Muscat                                | GST      | GST      | Asia/Muscat           |
| Azerbaijan Standard Time        | (UTC+04:00) Baku                                             | AZST     | AZT      | Asia/Baku             |
| Russia Time Zone 3              | (UTC+04:00) Izhevsk, Samara (RTZ 3)                          | SAMT     | SAMT     | Europe/Samara         |
| Mauritius Standard Time         | (UTC+04:00) Port Louis                                       | MUT      | MUT      | Indian/Mauritius      |
| Georgian Standard Time          | (UTC+04:00) Tbilisi                                          | GET      | GET      | Asia/Tbilisi          |
| Caucasus Standard Time          | (UTC+04:00) Yerevan                                          | AMST     | AMT      | Asia/Yerevan          |
| Afghanistan Standard Time       | (UTC+04:30) Kabul                                            | AFT      | AFT      | Asia/Kabul            |
| West Asia Standard Time         | (UTC+05:00) Ashgabat, Tashkent                               | TMT      | TMT      | Asia/Ashgabat         |
| Ekaterinburg Standard Time      | (UTC+05:00) Ekaterinburg (RTZ 4)                             | YEKT     | YEKT     | Asia/Yekaterinburg    |
| Pakistan Standard Time          | (UTC+05:00) Islamabad, Karachi                               | PKT      | PKT      | Asia/Karachi          |
| India Standard Time             | (UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi              | IST      | IST      | Asia/Kolkata          |
| Sri Lanka Standard Time         | (UTC+05:30) Sri Jayawardenepura                              | IST      | IST      | Asia/Colombo          |
| Nepal Standard Time             | (UTC+05:45) Kathmandu                                        | NPT      | NPT      | Asia/Kathmandu        |
| Central Asia Standard Time      | (UTC+06:00) Astana                                           | ALMT     | ALMT     | Asia/Almaty           |
| Bangladesh Standard Time        | (UTC+06:00) Dhaka                                            | BDT      | BDT      | Asia/Dhaka            |
| N. Central Asia Standard Time   | (UTC+06:00) Novosibirsk (RTZ 5)                              | NOVT     | NOVT     | Asia/Novosibirsk      |
| Myanmar Standard Time           | (UTC+06:30) Yangon (Rangoon)                                 | MMT      | MMT      | Asia/Rangoon          |
| SE Asia Standard Time           | (UTC+07:00) Bangkok, Hanoi, Jakarta                          | WIB      | WIB      | Asia/Jakarta          |
| North Asia Standard Time        | (UTC+07:00) Krasnoyarsk (RTZ 6)                              | KRAT     | KRAT     | Asia/Krasnoyarsk      |
| China Standard Time             | (UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi            | CST      | CST      | Asia/Chongqing        |
| North Asia East Standard Time   | (UTC+08:00) Irkutsk (RTZ 7)                                  | IRKT     | IRKT     | Asia/Irkutsk          |
| Singapore Standard Time         | (UTC+08:00) Kuala Lumpur, Singapore                          | SGT      | SGT      | Asia/Singapore        |
| W. Australia Standard Time      | (UTC+08:00) Perth                                            | AWST     | AWST     | Australia/Perth       |
| Taipei Standard Time            | (UTC+08:00) Taipei                                           | CST      | CST      | Asia/Taipei           |
| Ulaanbaatar Standard Time       | (UTC+08:00) Ulaanbaatar                                      | ULAT     | ULAT     | Asia/Ulaanbaatar      |
| North Korea Standard Time       | (UTC+08:30) Pyongyang                                        | KST      | KST      | Asia/Pyongyang        |
| Tokyo Standard Time             | (UTC+09:00) Osaka, Sapporo, Tokyo                            | JST      | JST      | Asia/Tokyo            |
| Korea Standard Time             | (UTC+09:00) Seoul                                            | KST      | KST      | Asia/Seoul            |
| Yakutsk Standard Time           | (UTC+09:00) Yakutsk (RTZ 8)                                  | YAKT     | YAKT     | Asia/Yakutsk          |
| Cen. Australia Standard Time    | (UTC+09:30) Adelaide                                         | ACDT     | ACST     | Australia/Adelaide    |
| AUS Central Standard Time       | (UTC+09:30) Darwin                                           | ACST     | ACST     | Australia/Darwin      |
| E. Australia Standard Time      | (UTC+10:00) Brisbane                                         | AEST     | AEST     | Australia/Brisbane    |
| AUS Eastern Standard Time       | (UTC+10:00) Canberra, Melbourne, Sydney                      | AEDT     | AEST     | Australia/Sydney      |
| West Pacific Standard Time      | (UTC+10:00) Guam, Port Moresby                               | ChST     | ChST     | Pacific/Guam          |
| Tasmania Standard Time          | (UTC+10:00) Hobart                                           | AEDT     | AEST     | Australia/Hobart      |
| Magadan Standard Time           | (UTC+10:00) Magadan                                          | MAGT     | MAGT     | Asia/Magadan          |
| Vladivostok Standard Time       | (UTC+10:00) Vladivostok, Magadan (RTZ 9)                     | VLAT     | VLAT     | Asia/Vladivostok      |
| Russia Time Zone 10             | (UTC+11:00) Chokurdakh (RTZ 10)                              | MAGT     | MAGT     | Asia/Srednekolymsk    |
| Central Pacific Standard Time   | (UTC+11:00) Solomon Is., New Caledonia                       | NCT      | NCT      | Pacific/Noumea        |
| Russia Time Zone 11             | (UTC+12:00) Anadyr, Petropavlovsk-Kamchatsky (RTZ 11)        | ANAT     | ANAT     | Asia/Anadyr           |
| New Zealand Standard Time       | (UTC+12:00) Auckland, Wellington                             | NZDT     | NZST     | Pacific/Auckland      |
| Fiji Standard Time              | (UTC+12:00) Fiji                                             | FJST     | FJT      | Pacific/Fiji          |
| Kamchatka Standard Time         | (UTC+12:00) Petropavlovsk-Kamchatsky - Old                   | PETT     | PETT     | Asia/Kamchatka        |
| Tonga Standard Time             | (UTC+13:00) Nuku'alofa                                       | TOT      | TOT      | Pacific/Tongatapu     |
| Samoa Standard Time             | (UTC+13:00) Samoa                                            | SST      | SST      | Pacific/Samoa         |
| Line Islands Standard Time      | (UTC+14:00) Kiritimati Island                                | LINT     | LINT     | Pacific/Kiritimati    |
| Azores Standard Time            | (UTC-01:00) Azores                                           | AZOST    | AZOT     | Atlantic/Azores       |
| Cape Verde Standard Time        | (UTC-01:00) Cabo Verde Is.                                   | CVT      | CVT      | Atlantic/Cape_Verde   |
| Mid-Atlantic Standard Time      | (UTC-02:00) Mid-Atlantic - Old                               | UTC-2    | UTC-2    |                       |
| E. South America Standard Time  | (UTC-03:00) Brasilia                                         | BRT      | BRST     | America/Sao_Paulo     |
| SA Eastern Standard Time        | (UTC-03:00) Cayenne, Fortaleza                               | GFT      | GFT      | America/Cayenne       |
| Argentina Standard Time         | (UTC-03:00) City of Buenos Aires                             | ART      | ART      | America/Buenos_Aires  |
| Greenland Standard Time         | (UTC-03:00) Greenland                                        | WGST     | WGT      | America/Godthab       |
| Montevideo Standard Time        | (UTC-03:00) Montevideo                                       | UYST     | UYT      | America/Montevideo    |
| Bahia Standard Time             | (UTC-03:00) Salvador                                         | BRT      | BRT      | America/Bahia         |
| Pacific SA Standard Time        | (UTC-03:00) Santiago                                         | CLST     | CLT      | America/Santiago      |
| Newfoundland Standard Time      | (UTC-03:30) Newfoundland                                     | NDT      | NST      | America/St_Johns      |
| Paraguay Standard Time          | (UTC-04:00) Asuncion                                         | PYST     | PYT      | America/Asuncion      |
| Atlantic Standard Time          | (UTC-04:00) Atlantic Time (Canada)                           | ADT      | AST      | Canada/Atlantic       |
| Central Brazilian Standard Time | (UTC-04:00) Cuiaba                                           | AMST     | AMT      | America/Cuiaba        |
| SA Western Standard Time        | (UTC-04:00) Georgetown, La Paz, Manaus, San Juan             | AMT      | AMT      | America/Manaus        |
| Venezuela Standard Time         | (UTC-04:30) Caracas                                          | VET      | VET      | America/Caracas       |
| SA Pacific Standard Time        | (UTC-05:00) Bogota, Lima, Quito, Rio Branco                  | PET      | PET      | America/Lima          |
| Eastern Standard Time (Mexico)  | (UTC-05:00) Chetumal                                         | EDT      | EST      |                       |
| Eastern Standard Time           | (UTC-05:00) Eastern Time (US & Canada)                       | EDT      | EST      | Canada/Eastern        |
| US Eastern Standard Time        | (UTC-05:00) Indiana (East)                                   | EDT      | EST      | America/Indiana/Vevay |
| Central America Standard Time   | (UTC-06:00) Central America                                  | CDT      | CST      |                       |
| Central Standard Time           | (UTC-06:00) Central Time (US & Canada)                       | CDT      | CST      | Canada/Central        |
| Central Standard Time (Mexico)  | (UTC-06:00) Guadalajara, Mexico City, Monterrey              | CDT      | CST      | America/Mexico_City   |
| Canada Central Standard Time    | (UTC-06:00) Saskatchewan                                     | CST      | CST      | Canada/Saskatchewan   |
| US Mountain Standard Time       | (UTC-07:00) Arizona                                          | MST      | MST      | America/Phoenix       |
| Mountain Standard Time (Mexico) | (UTC-07:00) Chihuahua, La Paz, Mazatlan                      | MDT      | MST      | America/Chihuahua     |
| Mountain Standard Time          | (UTC-07:00) Mountain Time (US & Canada)                      | MDT      | MST      | Canada/Mountain       |
| Pacific Standard Time (Mexico)  | (UTC-08:00) Baja California                                  | PDT      | PST      | Mexico/BajaNorte      |
| Pacific Standard Time           | (UTC-08:00) Pacific Time (US & Canada)                       | PDT      | PST      | Canada/Pacific        |
| Alaskan Standard Time           | (UTC-09:00) Alaska                                           | AKDT     | AKST     | America/Anchorage     |
| Hawaiian Standard Time          | (UTC-10:00) Hawaii                                           | HST      | HST      | Pacific/Honolulu      |
| Dateline Standard Time          | (UTC-12:00) International Date Line West                     | IDLW     | IDLW     |                       |
+---------------------------------+--------------------------------------------------------------+----------+----------+-----------------------+

使用Ascii Table Generator创建的表格。 有用的链接可以找到这个信息:

如果我有日光/标准时间倒退,请发表评论。我知道有些地方有更好的缩写(HKT而不是CST),我只是严格遵循PHP给我的内容。有时候没有明显的缩写,用空白" PHP Zone"条目。

这是我的PHP代码段,用于显示缩写:

<?php

$in = trim("Canada/Pacific");
echo $in . "<br>";
date_default_timezone_set($in); 
$dateJan15 = new DateTime('01/15/2011');
$dateJuly15 = new DateTime('07/15/2011');
$isJanDaylight = date_format($dateJan15, 'I') == 1;
$isJulyDaylight = date_format($dateJuly15, 'I') == 1;
echo "<br>January: " . date_format($dateJan15, 'T Z') . ($isJanDaylight ? " *Daylight": "");
echo "<br>July: " . date_format($dateJuly15, 'T Z') . ($isJulyDaylight ? " *Daylight": "");
?>