PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Gobinath Mallaiyan   Date Compare   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example Using this Class
Class: Date Compare
Calculate and compare dates
Author: By
Last change:
Date: 19 years ago
Size: 786 bytes
 

Contents

Class file image Download
<?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";
}

?>