我是用到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
来源:学生作业帮助网 编辑:作业帮 时间:2024/05/08 13:53:14
我是用到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
我是用到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.
我是用到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
这只是一个警告(Warning),虽然可以忽略,但可能会发生执行结果错误.
你写的 date(Y-m-d H:i:s) 参数有问题,正确的写法是:
date('Y-m-d H:i:s',time()); //后面的,time()可以省略,但最好形成习惯写上,比较规范.
另外,如果你设置了时间区域(比如中国上海等),会更准确一些.
比如在文件的最前面这样写: