- strftime: documentation ( source)
- strtotime: documentation ( source)
<?php
$calcul = (strtotime("today") - strtotime("12-09-2013"));
echo strftime("%d-%m-%Y", $calcul) . '<br />';
echo strftime("%d-%m-%Y", strtotime("today"));
$date1 = new DateTime("03-24-2007");
$date2 = new DateTime("03-26-2009");
$interval = $date1->diff($date2);
echo "difference " . $interval->y . " years, " . $interval->m." months, ".$interval->d." days ";