目前我收到错误:
DateTimeZone :: __ construct():未知或错误的时区()
错误来自这段代码 - 任何想法?
protected function _resolveTimeZone($timeZone, $useDst)
{
$time = new DateTime('now', new DateTimeZone($timezone));
$offset = $time->getTimezone()->getOffset($time) / 60 / 60;
$timeZone = $this->_importModel->resolveTimeZoneOffset($offset, $useDst);
return $timeZone;
}
答案 0 :(得分:1)
将$timezone
重命名为$timeZone
。并查看$timeZone
是哪个受支持的时区:http://php.net/manual/en/timezones.php