.
Divya
In PHP the date_diff() function used to returns the difference between two DateTime.
date_diff(datetime1,datetime2,absolute);
<!DOCTYPE html>
<html>
<body>
<?php
$date1=date_create("2017-11-12");
$date2=date_create("2017-12-12");
$diff=date_diff($date1,$date2);
$difference=$diff->format("%R%a days");
echo substr("$difference",1);
?>
</body>
</html>
30 days
.