Tôi cố gắng để chạy kịch bản này:DateTimeZone lỗi: Unknown hay xấu múi giờ
<?php
$d = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$time = $d->format('H:i');
echo $time;
?>
nhưng tôi đã nhận lỗi này:
Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() [<a href='function.DateTimeZone---construct'>function.DateTimeZone---construct</a>]: Unknown or bad timezone (Asia/Kolkata)
Mặc dù nó hoạt động tốt cho Asia/Dacca
ví dụ. Điều gì có thể là vấn đề và cách khắc phục?
'print_r (DateTimeZone :: listIdentifiers()); 'hiện nó trở lại' châu Á/Kolkata'? – ajreal