I need to get exit next date of payment of loan:
as loan date: 1-1-2020
loan period: 2 years 5 months
payment date: ? ?
calculating expected date of payment
// calculating next payment date
date("Y-M-D", strtotime(date("2020-1-1")." + 2 years + 2 months"))
2
Answers
Try this,
IT will output the date that is 2 years and 5 months after January 1, 2020. In this case, it would output 2022-06-01.
DateInterval Format Components
P – Starts the period
Date Components
Y – Years (e.g., 2Y for 2 years)
M – Months (e.g., 5M for 5 months)
D – Days (e.g., 10D for 10 days)
Try this, your code is correct and the date format is incorrect:
OR