Hi;
I need to calculate this time format 00:00:000 (like: 12:34:768) from 0.0 this format , does any one know how to handle this in php?
eg: 54:73:733(time format) - 13.7(any digit between 0.0 to 20.0) = ??
how to calculate this format
Moderator: General Moderators
Re: how to calculate this format
Please make it more clear.
Re: how to calculate this format
it s a game , and i ve to deduct a digit between 0 to 20 from this time format 00:00:000
means $latestscore = $score-$medal;
$score=99:99:999;
$medal= 18.7 ;
now how to do this calculation ;
$latestscore = $score-$medal;
means $latestscore = $score-$medal;
$score=99:99:999;
$medal= 18.7 ;
now how to do this calculation ;
$latestscore = $score-$medal;
Re: how to calculate this format
Still i am not clear with you.
What does this $score mean?
I mean, you have separated the score into three parts. Like
AA:BB:CCC and how does the medal related to the score?
What does this $score mean?
I mean, you have separated the score into three parts. Like
AA:BB:CCC and how does the medal related to the score?
Re: how to calculate this format
Try explode() ing your numbers and operating on the resulting array.
Re: how to calculate this format
the $medal is a digit from 0 to 20 , that is only a point that user collect up to now... can be 19.9 ,5.8 ,2 or any number between 0 to 20 , but the $score is the time format , 00:00:000 min, second and millisecond...
my problem is i dont know how to deduct time format from number ;
eg = 98:88:999 - 8.7 =??
my problem is i dont know how to deduct time format from number ;
eg = 98:88:999 - 8.7 =??
Re: how to calculate this format
Then as omniuni said, use explode() function and do the calculation.
Re: how to calculate this format
yes explode is ok but if the case is like 01:24:222-19.8 = then when i want to borrow from 01 then its value is not 1 , is 60...
- novice4eva
- Forum Contributor
- Posts: 327
- Joined: Thu Mar 29, 2007 3:48 am
- Location: Nepal
Re: how to calculate this format
When you say 01:24:222-19.8 does it mean like 01-00:24-19:222-8, i mean that 19.8 is actually time with 19 sec and 8 millisec ??? It must be the case because if 19.8 were millisec then 19 will be millisec and 0.8 will be something micro sec!!! It seems like you know explode, the best thing would be change everything to milliseconds, do the subtraction and make it to the form you desire which seems like MM:SS:(MILLISEC) 