网站的Datetimezone错误

时间:2018-05-21 21:11:24

标签: php apache datetime timezone

当我尝试进入该网站时,会出现一个白页

[Mon May 21 21:06:21.190385 2018] [:error] [pid 13340] [client 89.64.24.10:19041] PHP Notice:  Undefined property: object::$default_timezone in /var/www/html/frontend/lib/common.php on line 92
[Mon May 21 21:06:21.193439 2018] [:error] [pid 13340] [client 89.64.24.10:19041] PHP Notice:  date_default_timezone_set(): Timezone ID '' is invalid in /var/www/html/frontend/lib/common.php on line 92
[Mon May 21 21:06:21.193476 2018] [:error] [pid 13340] [client 89.64.24.10:19041] PHP Notice:  Undefined property: object::$default_timezone in /var/www/html/frontend/lib/common.php on line 93
[Mon May 21 21:06:21.193603 2018] [:error] [pid 13340] [client 89.64.24.10:19041] PHP Fatal error:  Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone () in /var/www/html/frontend/lib/common.php:93\nStack trace:\n#0 /var/www/html/frontend/lib/common.php(93): DateTimeZone->__construct('')\n#1 /var/www/html/frontend/htdocs/index.php(4): include('/var/www/html/f...')\n#2 {main}\n  thrown in /var/www/html/frontend/lib/common.php on line 93

时区线92-93-94-95(common.php)

date_default_timezone_set($CFG->default_timezone);
$dtz = new DateTimeZone($CFG->default_timezone);
$dtz1 = new DateTime('now', $dtz);
$CFG->timezone_offset = $dtz->getOffset($dtz1);

0 个答案:

没有答案