Location: PHPKode > scripts > Date Compare > date-compare/example.php
<?php

include_once("DateAdd.class.php");
echo "<b><u>Get Next Month Date</u></b><br>";
$date = "1-25-2005";
$dateFormat="m d Y";
$strSeperator="-";
echo "Parameter Date : ".$date."<br>";
$dateAd = new DateCK($date,$dateFormat,$strSeperator);
$tmpDate=$dateAd->MonthDate("Month");
echo "Next Month Date : ".$tmpDate."<br>";


$date = "01-12-2005";
$dateFormat="m d Y";
$strSeperator="-";
echo "<br><b><u>Check The date Whether its greater than server date or not</u></b><br>";
$dateCk = new DateCK($date,$dateFormat,$strSeperator);
$result=$dateCk->DateCheck();
echo "Your Date : ".$date;
echo "<br>Server Date :".date("m-d-Y")."<BR>";  
if($result){
  echo "The date is Greater than Server Date";
}
else{
  echo "Your Date is Less than Server Date";
}

?>
Return current item: Date Compare