今天的日期strtotime显示昨天的日期在23:59:59之后未更改

问题描述 投票:0回答:1

我想在选项中回显今天的日期,但今天的strtotime日期在23:59:59之后不改变,而是在早上5:30以后改变。现在今天的日期是01-10-2019,但它仍然向我显示30-09-2019 ..如何回应今天的strtotime,它在23:59:59之后发生变化,我们将不胜感激。在此先感谢..

<?php echo date("d-m-Y", strtotime("today")); ?>
php date strtotime
1个回答
0
投票

经过数小时的搜索,我发现这是答案。

<?php
date_default_timezone_set('Asia/Kolkata');
echo date("d-m-Y", strtotime("today"));
?>
© www.soinside.com 2019 - 2024. All rights reserved.