Hello i have problem is i have penny auction script and i try to add auction

and it show on indexpage assume 05-05-2011 but when the time hit 00.00 so date become to 6 and back to 5 in the morning maybe 12 hour

and i try to change var.match round to var math.floor

date become to 4 before midnight 2 minute and back to 5 when the time hit midnight again...so if this day is 5 and before midnight it will not become to 4 but when midnight come it will become to 6...so i dont know when item can end then

this is code if someone can sort it out

function calc_counter_from_time22(diff)
{

if (diff > 0) {
hours=Math.floor(diff / 3600)
minutes=Math.floor((diff / 3600 - hours) * 60)
seconds=Math.round((((diff / 3600 - hours) * 60) - minutes) * 60)
} else {
hours = 0;
minutes = 0;
seconds = 0;
}

if(diff < 86400){
return twodigit(hours) + ":" + twodigit(minutes) + ":" + twodigit(seconds);
}
else{


var Tday = Math.floor(diff / (60 * 60 * 24));

var addDay = Tday;
var d = new Date();
d.setDate(d.getDate()+addDay);
mkMonth=d.getMonth()+1;
mkMonth=new String(mkMonth);
if(mkMonth.length==1){
mkMonth="0"+mkMonth;
}
mkDay=d.getDate();
mkDay=new String(mkDay);
if(mkDay.length==1){
mkDay="0"+mkDay;
}
mkYear=d.getFullYear();
return mkDay+"-"+mkMonth+"-"+mkYear;
}