[PHP] Difference between 2 time entries

2006-07-20 Thread Chris Grigor
Morning all, I am looking to get the differnce in hours / minutes between 2 values. Currently I have 2 time entries being retruned from mysql, one which is a start time and the other which is a finish time. So $start = '13:12:17'; $finish = '23:12:17'; How would one get the differnce between

Re: [PHP] Difference between 2 time entries

2006-07-20 Thread nicolas figaro
Chris Grigor a écrit : Morning all, I am looking to get the differnce in hours / minutes between 2 values. Currently I have 2 time entries being retruned from mysql, one which is a start time and the other which is a finish time. So $start = '13:12:17'; $finish = '23:12:17'; How would one

[PHP] Difference between 2 time entries

2006-07-20 Thread Chris Grigor
Morning all, I am looking to get the differnce in hours / minutes between 2 values. Currently I have 2 time entries being retruned from mysql, one which is a start time and the other which is a finish time. So $start = '13:12:17'; $finish = '23:12:17'; How would one get the differnce between

Re: [PHP] Difference between 2 time entries

2006-07-20 Thread John Meyer
|Found this on the PHP web site, you can add the conversions as the first lines in the functions. function callDuration($dateTimeBegin,$dateTimeEnd) { $dif=$dateTimeEnd - $dateTimeBegin; $hours = floor($dif / 3600); $temp_remainder = $dif - ($hours * 3600); $minutes

Re: [PHP] Difference between 2 time entries

2006-07-20 Thread tedd
At 1:51 PM +0200 7/20/06, nicolas figaro wrote: IMHO, the best is to generate a timestamp using mktime for each date. you can the calculate the difference of timestamps and convert it back using date. $tm_start = mktime(substr($start,0,2),substr($start,3,2), substr($start,5,2)); $tm_finish =

Re: [PHP] Difference between 2 time entries

2006-07-20 Thread tedd
At 12:41 PM +0200 7/20/06, Chris Grigor wrote: Morning all, I am looking to get the differnce in hours / minutes between 2 values. Currently I have 2 time entries being retruned from mysql, one which is a start time and the other which is a finish time. So $start = '13:12:17'; $finish =