how to get date/day difference between current date and added date in php
<?php
$now = time(); // or your date as well
$your_date = strtotime('Y-m-d'); // Insert date in this format
$datediff = $now - $your_date;
echo floor($datediff / (60 * 60 * 24));
?>
$now = time(); // or your date as well
$your_date = strtotime('Y-m-d'); // Insert date in this format
$datediff = $now - $your_date;
echo floor($datediff / (60 * 60 * 24));
?>
Comments
Post a Comment