PHP If Date Not Working in 2012

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 :slight_smile:

//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;

Hi all, bit of an update - seems as though I’ve snookered those on here also!! The problem was with using - in the date. Obviously was getting mixed up with the strtotime functions - 1 week, etc. So instead I’ve used slashes instead of hyphens.

date('d/m/Y H:i', strtotime(str_replace('-', '/', '21-12-2011 15:30')));

Hope this helps someone out there should they stumble across this…