So this is based on 1-2 days delivery. If they order it by 13:00 on say, a Friday, then it won't be delivered on the Sat or Sun, so will be on a Monday.
I'm sure I can work all this out, but it's doing something weird that I cannot spot.
It should be echoing Saturday I think. Adding 1 day to 17 July. But itstead, it is showing Thursday.
It doesn't matter if I make 17, 18 or 19 or 12, it still shows Thursday.
I just don't see why.
Code: Select all
<?php
//$todaydate = date('Y-m-d');
$todaydate = "2015-07-17";
$orderedon=strftime("%A",strtotime("$todaydate"));
// $todayhour = date('H');
$todayhour = "13";
$day=strftime("%A",time());
echo "</div><div class='cat_head'>Ordered at $todayhour:00 on $orderedon</div><div class='mainbodybox'><br/>";
if ($todayhour <= "13")
{
// add two days to current day
//$onedays = date('Y-m-d', strtotime("+1 days"));
$onedays = date('$todaydate', strtotime("+1 days"));
$onedays=strftime("%A",strtotime("$onedays"));
echo "$onedays";
}
?>