- time: documentation ( source)
- date: documentation ( source)
<?php
$date1 = new DateTime("2007-03-24");
$date2 = date("Y-m-d", time());
$interval = $date1->diff($date2);
echo "difference " . $interval->y . " years, " . $interval->m." months, ".$interval->d." days ";
?>