Timestamp - php using strtotime to convert time to 6 more hours
高洛峰
高洛峰 2017-05-16 13:02:59
0
3
611

The time obtained using the time function is normal

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(3)
某草草

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template