
- You are not logged in. | Login
November 14, 2006 10:21 pm
- sam43inwood
- Member


find the time difference between two dates
I need someone to help me figure out how to take two dates and find the number of days, hours, minutes and seconds between them.
My dates are in the format MM/DD/YYYY HH:MM:SS
so if I have $date1 = "01/30/2005 12:45:02" and $date2 = "02/01/2005 12:45:02" I want to get ' 2 days, 0 hours, 0 minutes, 0 seconds '
November 30, 2006 2:23 pm
- reetesh
- Member


Re: find the time difference between two dates
Hi,
End Date 11/21/2006 1:30
Start Date 11/20/2006 23:30
Formula
=TRUNC(B9-B10)&IF(TRUNC(B9-B10)=1," day "," days ")&HOUR(B9-B10)&IF(HOUR(B9-B10)=1," hour "," hours ")&MINUTE(B9-B10)&IF(MINUTE(B9-B10)=1," minute "," minutes")
You would get the result as
0 days 2 hours 0 minutes
Let me know if it works for you
Regards,
Reetesh


