<?php
$firstDate = date("Y-m-d");
echo "firstDate:";
echo "<br>";
echo $firstDate;
$nextTime = time() + (365 * 24 * 60 * 60);
$secondDate = date('Y-m-d',$nextTime);
echo "<br>";
echo "secondDate:";
echo "<br>";
echo $secondDate;
require("dateClass.php");
echo "<br>";
echo "difference in seconds:";
echo "<br>";
$seconds = new dateDiff($firstDate,$secondDate,s);
echo $seconds->calDiff();
echo "<br>";
echo "difference in minutes:";
echo "<br>";
$minutes = new dateDiff($firstDate,$secondDate,m);
echo $minutes->calDiff();
echo "<br>";
echo "difference in hours:";
echo "<br>";
$hours = new dateDiff($firstDate,$secondDate,h);
echo $hours->calDiff();
echo "<br>";
echo "difference in days:";
echo "<br>";
$days = new dateDiff($firstDate,$secondDate,d);
echo $days->calDiff();
echo "<br>";
echo "difference in months:";
echo "<br>";
$months = new dateDiff($firstDate,$secondDate,mm);
echo $months->calDiff();
echo "<br>";
echo "difference in years:";
echo "<br>";
$years = new dateDiff($firstDate,$secondDate,y);
echo $years->calDiff();
?>
|