phpCopy$firstDate = new DateTime("2019-01-01");
$secondDate = new DateTime("2020-03-04");
$intvl = $firstDate->diff($secondDate);
echo $intvl->y . " year, " . $intvl->m." months and ".$intvl->d." day";
echo "
";
// Total amount of days
echo $intvl->days . " days ";
//output: 1 year, 2 months and 1 day
// 428 days