php日期+N days

发布时间:2022-10-18 20:10:21 阅读:975次

strtotime() 函数将任何英文文本的日期或时间描述解析为 Unix 时间戳(自 January 1 1970 00:00:00 GMT 起的秒数)。

echo(strtotime("now") . "<br>");
echo(strtotime("15 October 1980") . "<br>");
echo(strtotime("+5 hours") . "<br>");
echo(strtotime("+1 week") . "<br>");
echo(strtotime("+1 week 3 days 7 hours 5 seconds") . "<br>");
echo(strtotime("next Monday") . "<br>");
echo(strtotime("last Sunday"));

php中如何给指定的日期加几天

$created_at = '2022-10-18';
$nextWeekDay = date("Y-m-d H:i:s",strtotime("$created_at +7 days"));
echo $nextWeekDay;

如有问题,可以QQ搜索群1028468525加入群聊,欢迎一起研究技术

支付宝 微信

有疑问联系站长,请联系QQ:QQ咨询

转载请注明:php日期+N days 出自老鄢博客 | 欢迎分享