第二步:修改vendor/yiisoft/yii2/db/Connection.php 276行:添加 public $timeZone = ‘’;
找到 方法 initConnection 添加
if (KaTeX parse error: Expected 'EOF', got '&' at position 25: …eZone !== null &̲& in_array(this->getDriverName(), [‘mysql’, ‘mysqli’], true)) {
t
h
i
s
−
>
p
d
o
−
>
e
x
e
c
(
′
S
E
T
T
I
M
E
Z
O
N
E
=
"
′
.
this->pdo->exec('SET TIME_ZONE="'.
this−>pdo−>exec(′SETTIMEZONE="′.this->timeZone.’"’); }