How to convert milliseconds into minutes?
<p>i got one more problem if any one have any solution please help me.
Ploblem is like this I want to convert milliseconds into minutes in javascript and then decrement minutes by 60000 milliseconds untill it reaches current time for which i am using this code:-</p>

<pre><code>&lt;?php
$date2   = date('Y-m-d H:i:s');
$currentdate = strtotime($date2);
$targetdate = strtotime('2012-05-09 21:30:00');
?&gt;
&lt;script type=text/javascript&gt;
var currentdate = &lt;?php echo $currentdate; ?&gt;;
var targetdate = &lt;?php echo $targetdate; ?&gt;;
var difference = targetdate - currentdate;

var minutes = Math.floor(difference / 60);
var i = minutes;
var intID;
function decrementMin() {
    if(i==0)
    {
        clearInterval(intID);
        alert('Minute = Congratulation your time begin!');
    }
    if(i&gt;=0){
    document.getElementById('minutes').innerHTML = i + "minutes";
    i--;
    }
}
decrementMin();
intID = setInterval('decrementMin()', 60000);
&lt;/script&gt;
</code></pre>

<p>The problem is like that their are total 478 seconds and when we convert it into minutes then it become 7.9666 but by using Math.floor() it show's 7 minutes and give alert before .9666 second means before 58 seconds.
If any one have any solution please help me i am waiting for your answer please.</p>
