在 phpMyAdmin 中打印时生成时间错误

The Generation Time is wrong when pint in phpMyAdmin

我在 Win7+Chrome 中使用 phpMyAdmin 4.4.14,在 Linux 中使用 MySQL 5.6。

我的时区是+8

date 命令中 Linux returns 正确的日期和时间。

当我在 phpMyAdmin 中发出 select now() 时,日期和时间是正确的。

但是,当我打印结果时,Generation Time中的时间值是错误的。

看起来 Generation Time 没有按小时计算 +8。

如何修复?

干杯,
萧伟文

打印视图是通过 PHP 脚本完成的,因此问题出在 PHP,而不是 MySQL。为了更改此时间戳,您需要打开 php.ini 和 change/add date.timezone 具有所需值的变量:

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "Europe/Paris"

可在此处找到所有可用时区: http://www.php.net/manual/en/timezones.php