The time obtained using the time function is normal
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
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
Reference About the time zone issue of PHP functions time() date() and strtotime()
It is recommended to post the code
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
Check time zone
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
Reference About the time zone issue of PHP functions time() date() and strtotime()
It is recommended to post the code
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