澳大利亚/悉尼的 php 时区错误问题


php wrong timezone issue in Australia/Sydney

我想在澳大利亚/悉尼获取时区名称(不是时间)

http://php.net/manual/en/timezones.australia.php(时区设置)

$t = new DateTime('now'); 
$t->setTimeZone( new DateTimeZone('Australia/Sydney'));
echo $t->format("Y D M j H:i T");

结果 = 2014 周二 12月 16 17:54 EST

http://www.timeanddate.com/time/zones/aedt

在此 URL 中,澳大利亚/悉尼是 AEDT。为什么 php 返回 EST?

希望这对你有用

$test = new DateTimeZone('Australia/Sydney');
$gmt = new DateTimeZone('AEDT');
$date = new DateTime('2011-12-25 00:00:00', $test);
$date->setTimezone($gmt);
echo $date->format('Y-m-d H:i:s');

http://mm.icann.org/pipermail/tz-announce/2014-August/000023.html

澳大利亚 DST 时区缩写在使用date_default_timezone_set时不正确

这是版本问题。