johannijdam
5/10/2016 - 9:38 AM

Compare between date

Compare between date

<?php
function compare_visibility($startdate, $enddate){
	date_default_timezone_set('Europe/Amsterdam');
	$now = strtotime(date("Y-m-d H:i:s"));
	$start_date = strtotime($startdate);
	$end_date = strtotime($enddate);
	
	if($start_date < $now && $end_date > $now){
		return true;
	} else {
		return false;
	}
}
?>