date_diff not working.
Code:
$now = date('Y-m-d');
$pay_day = 2;
$pay_month = 11;
$pay_year = 2024;
$lastdatepaid = $pay_year. "-" .$pay_month. "-" .$pay_day;
echo "<p>Today's Date: $now</p>";
echo "<p>Last Date Paid: $lastdatepaid</p>";
$today = date_create($now);
date_add($today,date_interval_create_from_date_string("1 month, 6 days"));
$nextpaymentdate = date_format($today,"Y-m-d");
echo "<p>Next Payment date: $nextpaymentdate</p>";
$diff = date_diff($today,$nextpaymentdate);
$days = $diff->format("%a days");
echo "<p>Difference in $days</p>";