时间戳在phpmyadmin中显示错误的时间 [英] timestamp shows wrong time in phpmyadmin
问题描述
我在报告数据时遇到了不同的时区问题。
为了更改时间戳,我采取了以下步骤。
I have been facing the different timezone issues in reporting the data. In order to change the timestamp, I've taken following steps.
-
检查了mysql中的时间,显示完美的时间和时区。我已经用日期命令进行了检查。
Checked the time in mysql, its showing perfect time and timezone. I've checked with "date command".
运行此命令: SELECT @@ global.time_zone,@@ session.time_zone;
在mysql上显示为+05:30和+05:30。
running this: SELECT @@global.time_zone, @@session.time_zone;
on mysql shows, +05:30 and +05:30.
SELECT @@ system_time_zone;
给出的 IST也正确。
SELECT @@system_time_zone;
gives "IST" which is also correct.
我通过echo函数检查了php时间,这也是正确的,但是我不知道不知道为什么数据库中的时间戳显示UTC时间。
I checked the php time by echo function which is also right, but I don't know why timestamp in database shows UTC time.
推荐答案
请更改php.ini文件中的时区并重新启动网站服务器。
please change the timezone in php.ini file and restart your web server .
这篇关于时间戳在phpmyadmin中显示错误的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!