How can I convert seconds to minutes in jQuery while updating an element with the current time?
<p>So I see a number of ways to display allot of seconds in a (static) hr/min/sec.  However, I am trying to produce a visual count down timer:</p>

<pre><code>$('#someelement').html(minCounter + ' minutes ' + ((secCounter == 0) ? '' : (secCounter + ' seconds')));
</code></pre>

<p>My counter is reduced inside a SetInterval that triggers ever 1 second: </p>

<pre><code>//.......
var counter = redirectTimer;
jQuery('#WarningDialogMsg').html(minCounter + ' minutes ' + ((secCounter == 0) ? '' : (secCounter + ' seconds')));

//........

SetInternval( function() {
    counter -= 1;
    secCounter = Math.floor(counter % 60);
    minCounter = Math.floor(counter / 60);

//.......

  $('#someelement').html(minCounter + ' minutes ' + ((secCounter == 0) ? '' : (secCounter + ' seconds')));
}, 1000)
</code></pre>

<p>It is a two minute counter but I don't want to display 120 seconds.  I want to display 1 : 59 (and counting down).</p>

<p>I have managed to get it to work using the above, but my main question is: <strong>is there a more elegant way to accomplish the above?</strong> (note: I am redirecting once "counter == 0").</p>
