I have two dates of the form:
Start Date: 2007-03-24
End Date: 2009-06-26
Now I need to find the difference between these two in the following form:
2 years, 3 months and 2 days
How can I do this in PHP?
datediffdatetimePHP
I have two dates of the form:
Start Date: 2007-03-24
End Date: 2009-06-26
Now I need to find the difference between these two in the following form:
2 years, 3 months and 2 days
How can I do this in PHP?
Best Answer
I suggest to use DateTime and DateInterval objects.
read more php DateTime::diff manual
From the manual: