gpt4 book ai didi

php - 为什么亚洲/迪拜时区缩写在 timezonedb 和 tzdata 之间不同?

转载 作者:可可西里 更新时间:2023-11-01 00:40:07 27 4
gpt4 key购买 nike

我正在使用 php timezonedb 2017.2。

为什么它返回 +04 而不是亚洲/迪拜时区的 GST?
虽然默认内置 php tzdata 返回 GST。

$dt = new DateTime('now', new DateTimezone('Asia/Dubai'));
$dt->format('T'); // returns either GST or +04

php -v = PHP 5.5.38 (cli)(构建时间:2016 年 10 月 25 日 18:30:32)

最佳答案

基本上,因为时区数据随时间变化。听起来 timezonedb 是最新的,但 tzdata 不是。

此更改是在 IANA time zone data 的 2017a 版中进行的.

来自公告电子邮件 - 强调我的:

Changes to past and future time zone abbreviations

Switch to numeric time zone abbreviations for South America, as part of the ongoing project of removing invented abbreviations. This avoids the need to invent an abbreviation for the new Chilean new zone. Similarly, switch from invented to numeric time zone abbreviations for Afghanistan, American Samoa, the Azores, Bangladesh, Bhutan, the British Indian Ocean Territory, Brunei, Cape Verde, Chatham Is, Christmas I, Cocos (Keeling) Is, Cook Is, Dubai, East Timor, Eucla, Fiji, French Polynesia, Greenland, Indochina, Iran, Iraq, Kiribati, Lord Howe, Macquarie, Malaysia, the Maldives, Marshall Is, Mauritius, Micronesia, Mongolia, Myanmar, Nauru, Nepal, New Caledonia, Niue, Norfolk I, Palau, Papua New Guinea, the Philippines, Pitcairn, Qatar, Réunion, St Pierre & Miquelon, Samoa, Saudi Arabia, Seychelles, Singapore, Solomon Is, Tokelau, Tuvalu, Wake, Vanuatu, Wallis & Futuna, and Xinjiang; for 20-minute daylight saving time in Ghana before 1943; for half-hour daylight saving time in Belize before 1944 and in the Dominican Republic before 1975; and for Canary Islands before 1946, for Guinea-Bissau before 1975, for Iceland before 1969, for Indian Summer Time before 1942, for Indonesia before around 1964, for Kenya before 1960, for Liberia before 1973, for Madeira before 1967, for Namibia before 1943, for the Netherlands in 1937-9, for Pakistan before 1971, for Western Sahara before 1977, and for Zaporozhye in 1880-1924.

关于php - 为什么亚洲/迪拜时区缩写在 timezonedb 和 tzdata 之间不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43783147/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com