js実装-時間限定買い戻しスケジュール





         




function fresh()
{
        var endtime=new Date("2110/11/06,12:20:12");
        var nowtime = new Date();
        var leftsecond=parseInt((endtime.getTime()-nowtime.getTime())/1000);
        d=parseInt(leftsecond/3600/24);
        h=parseInt((leftsecond/3600)%24);
        m=parseInt((leftsecond/60)%60);
        s=parseInt(leftsecond%60);
       
//        document.getElementById("times").innerHTML=__h+"  "+__m+" "+__s+" ";
document.getElementById("times").innerHTML=h+"  "+m+" "+s+" ";
        if(leftsecond<=0){
        	document.getElementById("times").innerHTML="   ";
        	clearInterval(sh);
        }
}
var sh;
sh=setInterval(fresh,1000);