I am using 2 timestamp in my table which is starttime datatype- timestamp and as current timestamp. endtime datatype-timestamp and default as 0000-00-00 00:00:00
ho
You can convert your timestamps to unix timestamp (time in seconds) using php strtotime and then take the difference. You now have the difference in time in seconds and can convert to what you need...hours, min, days
http://php.net/manual/en/function.strtotime.php
ex:
$ts1 = strtotime($start);
$ts2 = strtotime($end);
$seconds_diff = $ts2 - $ts1;
$time = ($seconds_diff/3600);