PHP获取当前时间有错误解决(It is not safe to rely on the system's timezone settings) 2020-03-31 这个是时区问题,这里是一个可以运行的测试<?php date_default_timezone_set('PRC'); echo date('Y-m-d h:i:s', time()); ?>方法一:php.ini中修改为中国时区date.timezone = PRC方法二:在php文件中临时设置为中国时区date_default_timezone_set('PRC');推荐方法二
发表评论: