Source Code:
(back to article)
<?php $first_date = new DateTime('2022-01-01'); $second_date = new DateTime('2022-02-01'); $interval = date_diff($first_date, $second_date); echo $interval->format('%R%a days');
Result:
Report an issue