0

Possible Duplicate:
How to calculate the difference between two dates using PHP?

Since there clearly isn't any good canonical question on the subject, and over 5000 duplicates, I fell a canonical on the subject is in order. Please tell me if you find a duplicate with a good answer, detailing the steps and giving a correct, robust solution.

Given two example dates:

  1. 2012-11-30 17:03:30
  2. 2012-12-21 00:00:00

How can I find the difference between the two, and display it correctly?

Desired output:

20 days 6 hours 56 minutes 30 seconds

Community
  • 1
  • 1
Madara's Ghost
  • 172,118
  • 50
  • 264
  • 308

0 Answers0