View Full Version : time difference

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

And sum of two or more times...

06-22-2010, 09: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.

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

absolute makes the difference always positive.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum