{"title": "\u5904\u7406PHP\u51fd\u6570\u4e2d\u4f7f\u7528date\u547d\u4ee4\u65f6\u7684Warning", "update_time": "2014-04-27 15:11:43", "tags": "date php", "pid": "297", "icon": "php.png"}
在PHP代码中调用date函数时,在日志里看到如下报错 ``` PHP 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 'Asia/Chongqing' for 'CST/8.0/no DST' instead ``` 处理方法 在调用date前加入下代码 ``` ini_set('date.timezone','Asia/Shanghai'); ```