Currently I am using the code below to express a time in seconds (900) in seconds and minutes (15 mins 0 Seconds).
I am wondering if there is an easier way to achieve this as trying to use the same method fails for the first timer.
function cddisplay() {
// displays time in span
document.getElementById('timespan').innerHTML = Math.floor(count / 60) + ":" + count % 60;
if (scount % 60 >= 10) {
document.getElementById('timespan1').innerHTML = Math.floor(scount / 60) + ":" + scount % 60;
} else {
document.getElementById('timespan1').innerHTML = Math.floor(scount / 60) + ":0" + scount % 60;
}
};