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;
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.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.