gpt4 book ai didi

PHP strtotime 总是在午夜返回

转载 作者:行者123 更新时间:2023-12-03 01:15:57 26 4
gpt4 key购买 nike

我遇到了一个奇怪的问题。当我执行 strtotime 时,它​​不会考虑原始日期的小时部分,并且它总是在午夜返回。我尝试进行研究,但找不到任何具体内容。

我有什么遗漏吗?

$original_date = "2015-08-07 02:00:00";
$next_date = date('Y-m-d H:i:s', strtotime("monday this Week +1 week", strtotime($original_date)));

它将 $next_date 返回为 2015-08-14 00:00:00

最佳答案

试试这个,添加您想要在下一个日期检索的时间。

$original_date = "2015-08-07 02:00:00";
echo $next_date = date('Y-m-d H:i:s', strtotime("monday this Week 02:00:00 +1 week", strtotime($original_date)));

关于PHP strtotime 总是在午夜返回,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32132372/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com