DateTime值与当前时间不同 [英] DateTime Value not the same with current time

查看:94
本文介绍了DateTime值与当前时间不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!



我的PHP或MySQL有问题。它似乎没有返回当前的日期和时间。



当我像2015-28-01 1:47:00那样运行date()[这是现在的时间],它将保存在数据库2015- 01-28 06:47:30 ??



有人可以帮我解决这个问题吗?



非常感谢你,上帝保佑。 :)

解决方案

如果要永久设置它,请打开php.ini,然后添加或修改此指令:

 date.timezone =亚洲/新加坡



重新启动Apache,然后就可以了。

我使用新加坡时区作为示例


Hi!

I have a problem in my PHP or MySQL. It seems to be not returning the current Date and Time.

When I would run date() like 2015-28-01 1:47:00 [This is the time now], it would save in the database 2015-01-28 06:47:30??

Can someone help me to solve this?

Thank you so much and God bless. :)

解决方案

If you want to set it permanently, open the php.ini, and add or modify this directive:

date.timezone=Asia/Singapore


restart Apache, then it will be fine.
I am using Singapore timezone as an example.


这篇关于DateTime值与当前时间不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆