我试图运行此脚本:DateTimeZone错误:未知的或坏的时区
<?php
$d = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$time = $d->format('H:i');
echo $time;
?>
,但我得到这个错误:
Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() [<a href='function.DateTimeZone---construct'>function.DateTimeZone---construct</a>]: Unknown or bad timezone (Asia/Kolkata)
虽然它可以很好地用于Asia/Dacca
例如。可能是什么问题以及如何解决它?
`的print_r(DateTimeZone :: listIdentifiers());`它返回`亚洲/加尔各答'? – ajreal 2011-01-31 07:12:44