...

View Full Version : time difference



bamboli
06-22-2010, 09:53 AM
how calculate two indian time difference in php...

And sum of two or more times...

xGIHavoc
06-22-2010, 10:12 AM
function timedifference($time1, $time2)
{
$time1 = strtotime($firstTime);
$time2 = strtotime($lastTime);

$timedifference = $time2-$time1;

return $timedifference;
}

Same time zone, correct? That should do fine. For sum just change the negative to a positive and possibly just add additional parameters.

mlseim
06-22-2010, 05:26 PM
$timedifference = abs($time2-$time1);

absolute makes the difference always positive.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum