程序迁移到 PHP 5.3 后使用date()函数报错

Warning: date() [function.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 in /www/xxx.php

2个解决方法:

1、在使用date()前加入: date_default_timezone_set('Asia/Chongqing');

2、在php.ini中设置 date.timezone = "Asia/Chongqing"

你可能感兴趣的:(程序迁移到 PHP 5.3 后使用date()函数报错)