DateTimeZone error: Unknown or bad timezone
- by Falya
I am trying to run this script:
<?php
$d = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$time = $d->format('H:i');
echo $time;
?>
but I got this error:
Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() [<a href='function.DateTimeZone---construct'>function.DateTimeZone---construct</a>]: Unknown or bad timezone (Asia/Kolkata)
Though it works well for Asia/Dacca for example. What could be the problem and how to fix it?