在用date()的时候出现了错误
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. in G:\CILearning\www\phpstudy.php on line 11
原因是php所取的时间和当地时间有出入,所以导致错误的出现
解决办法:
在页头使用date_default_timezone_set()设置我的默认时区为北京时间,即
<?php
date_default_timezone_set("PRC");
?>就可以了。