How do you get PHP to return the timezone abbrevia

2019-09-07 01:53发布

I can't seem to find a way to get Pear's Date class (or PHP's date function) to return AEST as the timezone abbreviation for the timezone Australia/Melbourne. It always returns EST. I tried all the ways of printing out the timezone available in Date::format, format2, format3. Anyone know how to fix this? I'm running PHP 5.1.6, Pear Date 1.5.0a1, and the latest PECL timezonedb.

标签: php timezone
1条回答
ら.Afraid
2楼-- · 2019-09-07 02:14

Have you checked what it says in the time zone database for Australia/Melbourne? It is probably based on the Olson database, and when I last looked (2009a edition), it was still saying EST is the abbreviation for Australia/Melbourne. So, unless you have fixed the time zone database to say AEST, it is likely to continue to say EST. This has been debated on the TZ mailing list a few times; there isn't a settled answer, so the abbreviation remains unchanged.

查看更多
登录 后发表回答