开发者

Determine Next Day 6PM

开发者 https://www.devze.com 2022-12-13 04:54 出处:网络
<?php $start_date = \"12/10/2009 11:30\"; echo \"<br>start_date: $start_date<br>\"; $due_date1= date(\"m/d/Y H:i\", strtotime(\"+1 day\".$start_date));
<?php
$start_date = "12/10/2009 11:30";
echo "<br>start_date: $start_date<br>";

$due_date1   = date("m/d/Y H:i", strtotime("+1 day".$start_date));
$due_date2   = date("m/d/Y H:i", strtotime("+2 day 6pm".$start_date));
echo "<br>due开发者_如何学C_date1: $due_date1<br>";
echo "<br>due_date2: $due_date2<br>";
?>

See my code , I'm trying to get two dates from a start_date.

First one due_date1 is the exact 24 hours form the start_date and the second one due_date2 is 6pm after the second day of start_date

due_date1 is working correctly

What is wrong with due_date2 calculation?


you might as well go for

$due_date2   = date("m/d/Y 18:00", strtotime("+2 day".$start_date));
0

精彩评论

暂无评论...
验证码 换一张
取 消