Re: [PHP-DB] Subtraction of two units of time.

2003-03-06 Thread 1LT John W. Holmes
> I want to take away two times stored in the format "00:00:00" in a mysql > database, i retrieve the times and take them away by using the following > > $total = $time1 - $time2 ; > > when i echo the total it is a whole number of the hours.. and does not take > the minutes into account, anyone hav

Re: [PHP-DB] Subtraction of two units of time.

2003-03-06 Thread Peter Beckman
$foo = split(":",$time1); $bar = split(":",$time2); $time1 = mktime($foo[0],$foo[1],$foo[2],1,1,1980); $time2 = mktime($bar[0],$bar[1],$bar[2],1,1,1980); $total = $time1 - $time2; That will give you the difference in seconds between the two. I'll let you convert it to hh:mm:ss. Peter On Thu,