A-A+
wikimedia出现的PHP报时区变换警告问题
wiki系统不能发送确认邮件,请检查您的邮箱地址是否包含非法字符。
邮件传送员回应:It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 'UTC' for '8.0/no DST' instead
Php6不是不支持某些函数,而是不支持修改时区,在网上找了找就明白了,Php6认为这个行为不安全。在DATE()函数之前加入一句。
date_default_timezone_set('UTC');
这样就不报错了。