189 8069 5689

JS倒计时

var now = new Date();
var end = new  Date("Jun 17,2017 00:00:00");
function getTime(now, end){
    var time=Math.floor((end-now)/1000);//转化单位为秒。
    var day=Math.floor(time/86400);//1天86400秒;
    var hour =Math.floor(time%86400/3600);//1小时3600秒;
    var minute=Math.floor(time%3600/60);
    var second=Math.floor(time%60);
    return "还剩下"+day+"天"+hour+"小时"+minute+"分"+second+"秒";
}

标题名称:JS倒计时
当前网址:http://cdxtjz.com/article/jdohje.html

其他资讯