Hi all, I had an if statement which compared two dates, this is now not working since we’re in 2012, I can’t understand why not. It’s going to the second condition. Any help would be appreciated as always
//Check if time hasn't already passed...
if(date('d-m-Y H:i') >= date('d-m-Y H:i', strtotime('21-12-2011 '.$hour.':'.$minute))):
echo 'a';
$target = mktime($hour, $minute, 0, 01, 03, 2012);
$delivery_date = date('Y-m-d', strtotime("2012-01-04"));
elseif(date('w') == 5 || date('w') == 6 || date('w') == 0):
//Current day is a Fri, Sat or Sun...
$next_monday = date('j', strtotime("next monday"));
$target = mktime($hour, $minute, 0, date('m'), $next_monday, date('Y'));
$delivery_date = date('Y-m-d', strtotime("next tuesday"));
elseif(date('H:i', strtotime($hour.':'.$minute)) <= date('H:i')):
//Target time is less than real-time...
$next_day = date('j')+1;
$target = mktime($hour, $minute, 0, date('m'), $next_day, date('Y'));
$delivery_date = date('Y-m-d', strtotime("+ 2 day"));
else:
//Everything is just fine...
$target = mktime($hour, $minute, 0, date('m'), date('j'), date('Y'));
$delivery_date = date('Y-m-d', strtotime("+ 1 day"));
endif;