php5.1以上的版本获取时间有时区之分在php.ini里加入了date.timezone这个选项,设置值为date.timezone = "PRC"
并重启apache
问题就解决了
date('Y-m-d H:i:s',time());