Hello
I have two date :
1 2 3 | $first_date = new DateTime("2022-01-01"); $second_date = new DateTime("2023-02-02"); |
I need to calculate the difference between these two dates. I need the result like this:
1 2 | <difference> = 1 years, 1 months, 1 days <difference in days> =397 days |
How can I achieve this?
Please use this code:
It works as you expect