Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试回显当前的系统日期。但它输出明天的日期。我仔细检查了系统日期并测试了更改日期。回显时它仍然增加了 1 天。
可能是什么问题呢?
<?php echo date("Y-m-d"); ?>
如果未指定,则date()默认为当前 Unix 时间戳的第二个参数 - 自 01.01.1970, 0:00 GMT 以来的秒数。
date()
您可以使用它来设置您的时区,或手动将日期转换为正确的日期:date($format, time() + $difference).
date($format, time() + $difference)