Комментарии:
another easy way
$start = date_create('1987-06-03');
$end = date_create(); // Current time and date
$diff = date_diff($start, $end);
echo "<br>";
echo 'The difference is ';
echo $diff->y . ' years, ';
echo $diff->m . ' months, ';
echo $diff->d . ' days, ';
echo $diff->h . ' hours, ';
echo $diff->i . ' minutes, ';
echo $diff->s . ' seconds';
// Output changes based on the current time: The difference is 28 years, 5 months, 19 days, 20 hours, 34 minutes, 36 seconds
echo 'The difference in days : ' . $diff->days;
// Output: The difference in days : changes based on parameters
Exact ans is 1 year 10 month 27 days
ОтветитьResult is wrong bro. Check it
Ответить