我是用到date(Y-m-d H:i:s)函数的时候,错误提示如下:

问题描述:

我是用到date(Y-m-d H:i:s)函数的时候,错误提示如下:
Warning:date():It is not safe to rely on the system's timezone settings.You are *required* to use the date.timezone setting or the date_default_timezone_set() function.In case you used any of those methods and you are still getting this warning,you most likely misspelled the timezone identifier.We selected the timezone 'UTC' for now,but please set date.timezone to select your timezone.
1个回答 分类:综合 2014-11-28

问题解答:

我来补答
这只是一个警告(Warning),虽然可以忽略,但可能会发生执行结果错误.
你写的 date(Y-m-d H:i:s) 参数有问题,正确的写法是:
date('Y-m-d H:i:s',time()); //后面的,time()可以省略,但最好形成习惯写上,比较规范.
另外,如果你设置了时间区域(比如中国上海等),会更准确一些.
比如在文件的最前面这样写:
再问: 这个问题已经解决了,就是用上面你说的那个设置时间区域的问题,谢谢啊 你是不是也在学习php啊 ,希望你能留下qq号码,我好以后有问题想你请教?
 
 
展开全文阅读
剩余:2000
上一页:画钩的
下一页:速率
也许感兴趣的知识