Page 1 of 1

working with dates

Posted: Thu Jul 20, 2006 1:48 am
by spartan7
The issue is as follows :

I need to be able to calculate the amount of time that passes between two different dates.

eg.
$date1 = "5 Jun 2006 10:00"

$date2 = "7 Jun 2006 12:30"


I need to calculate the time it took between those two dates, and display the output as follows:
It took X days, X months, X years, X hours, X minutes, X seconds between date1 and date2

Is there a simple way of doing it?

Thanks

Posted: Thu Jul 20, 2006 2:39 am
by RobertGonzalez
This has been asked several times recently. Search the board for 'Date Difference' and select 'Match all terms'. There are over 100 results.

Posted: Mon Jul 24, 2006 3:28 pm
by Jeroen Oosterlaar
I believe you should be able to find some suitable solutions among the many plain date and time functions of PHP.