note 42775 deleted from function.date by tomsommer
| From: | tomsommer@php.net | Date: | Fri, 28 May 2004 20:39:47 +0000 |
| Subject: | note 42775 deleted from function.date by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-70259@lists.php.net to get a copy of this message | ||
Note Submitter: fariz@datasynx.com
----
########################################
# To divide $hours ( HH:ii ) - $hours ( HH:ii )
########################################
function div_hours ( $start , $end ) {
$hr_start = explode (":",$start);
$hr_end = explode (":",$end);
$hr_total_start = ( $hr_start[0] * 60 ) + $hr_start[1] ;
$hr_total_end = ( $hr_end[0] * 60 ) + $hr_start[1];
if ( $hr_total_start <= $hr_total_end ) {
$len = $hr_total_end - $hr_total_start ;
} else {
$len = ( $hr_total_end + 1440 ) - $hr_total_start ;
}
$result_h = floor( $len / 60 );
$result_i = $len % 60 ;
$total_result = $result_h.":".$result_i ;
return $total_result;
}