I have 2 date selector text boxes passing the values to my php page. I thought I could turn the vales into unix time stand and then disregard any positive or negative values. This works on most dates, but when I was testing it, It did not turn “02-19-2008 00:00:00” into a unix time stamp, so therefore it did not do the calculation need to tell if rage is valid. Here is what I had…
$startdate = strtotime($Psdate);
$enddate = strtotime($Pedate);
$datediff = $enddate – $startdate;
//test to see if these even are valid date
if (checkdate($smon,$sday,$syea) && checkdate($emon,$eday,$eyea))
{
if ($datediff >= 0)
{
echo “Range is Valid”;
}
else
{
$checkdate = 0;
echo “Range is Invalid”;
$err_array[] = “Incorrect Date Range”;
}
}