PHPBuilder - Time differnce functions for mins and hrs



RSS Twitter
Snippets Calendars Dates

Time differnce functions for mins and hrs

by: kartik
|
May 17, 2005

Version: 1.0

Type: Function

Category: Calendars/Dates

License: GNU General Public License

Description: Two functions that return difference in hrs and mins.



		<?php

function timediffhrs($timein, $timeout){								
										$timeinsec = strtotime ($timein);
										$timeoutsec = strtotime ($timeout);
							 $timetot = $timeoutsec - $timeinsec; 
							$timehrs  = intval($timetot/3600);
								$timehrsi =(($timetot/3600)-$timehrs)*60;
								$timemins = intval(($timetot/60) -$timehrs*60);
							return $timehrs;
								}
								
function timediffmins($timein, $timeout){								
										$timeinsec = strtotime ($timein);
										$timeoutsec = strtotime ($timeout);
							 $timetot = $timeoutsec - $timeinsec; 
							$timehrs  = intval($timetot/3600);
								$timehrsi =(($timetot/3600)-$timehrs)*60;
								$timemins = intval(($timetot/60) -$timehrs*60);
							return $timemins;
								}
												
?>
										
										

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
kartik

Comment:



Comment:

(Maximum characters: 1200). You have characters left.