<?php
include_once("DateAdd.class.php");
$fromdate = new DateCK("01-31-2005","-");
$todate = new DateCK("01/32/2005","/");
echo "<br>From Date : ";
$fromdate->display();
echo "<br>To Date : ";
$todate->display();
$compareStatus = $fromdate->comparedates($todate);
if ($compareStatus==-10) {
echo "<br>Invalid dates";
}
else if ($compareStatus==-1) {
echo "<br>From date is greater than to date";
}
else if ($compareStatus==0) {
echo "<br>Both dates are the same";
}
else if ($compareStatus==1) {
echo "<br>To date is greater than from date";
}
else {
echo "<br>Failed to compare";
}
?>
|