The time obtained using the time function is normal
某草草2017-05-16 13:04:59
Check time zone
echo date('Y-m-d H:i',0);
If it is Beijing time, then this will output 1970-01-01 08:00
If it’s really wrong and you need to set it up, you can use this
date_default_timezone_set('America/Los_Angeles');//设置为LAX
//中国是PRC
黄舟2017-05-16 13:04:59
Reference About the time zone issue of PHP functions time() date() and strtotime()
It is recommended to post the code
为情所困2017-05-16 13:04:59
It’s a time zone problem. Set the time zone to date_default_timezone_set("PRC") or set
'timeZone'=>'Asia/shanghai' in Yii config->main.php to solve the problem