我在Win7+Chrome中使用了MySQL 4.4.14,在Linux中使用了MySQL 5.6。
我的时区是+8
Linux中的date命令返回正确的日期和时间。
当我在select now()中发出phpMyAdmin时,日期和时间是正确的。
但是,当我打印结果时,Generation Time中的时间值是错误的。
看起来,Generation Time不会对小时执行+8操作。
怎么修?
干杯,
Alvin SIU
发布于 2016-02-25 09:52:41
打印视图是通过PHP脚本完成的,所以问题在PHP中,而不是在MySQL中。为了更改这个时间戳,您需要打开php.ini并使用所需的值更改/添加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
https://stackoverflow.com/questions/35621497
复制相似问题