How to calculate the difference between two dates using PHP? 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? Answer :     For PHP < 5.3 otherwise see jurka's answer below You can use strtotime() to convert two dates to unix time and then calculate the number of seconds between