Jump to content

[SOLVED] Calculating with Time (timeerror)


ramli

Recommended Posts

I am traying to calculate time. i have the following script.

 

 


while ... loop 
{
$diftot = strtotime($dif);
$subtotal = $subtotal + $diftot;
}

function timecalc($var1,$var2,$method)
{

	$varmktime = $var1;
	$varmktime = time_int($varmktime);
	$varmktime = ($varmktime['uur'].":".$varmktime['minuut'].":".$varmktime['seconde']);

	// 0:0:0 convert to 00:00:00
	$tijdstukken = explode(":", $varmktime);
	$varmktime = date("H:i:s", mktime($tijdstukken[0], $tijdstukken[1], $tijdstukken[2])); 
         
	$var['mktime'] = $varmktime;

return $var;

}

$subtotal = timecalc($subtotal,'0','mktime');
echo($subtotal['mktime']);

 

I have created a while loop where all enterys are added to eatchother. i inputted:

 

diferrence 1:  00:00:07 is 1174777207

difference 2:            00:00:03 is 1174777203

Total is :                2349554410 milliseconds

 

But when i try to calculate the total it outputs 22:00:10 insted of 00:00:10. Can anybody help me with this problem please.

 

Thx in advance....

Link to comment
https://forums.phpfreaks.com/topic/44228-solved-calculating-with-time-timeerror/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.