limitFormatTime(date) { var that=this; // 日期格式为 [2019-05-09 20:10:10] date = date.replace(/-/g,'/'); var timestamp = (new Date(date)).valueOf(); var nowstr = (new Date()).valueOf(); setInterval(function(){ nowstr=nowstr-1000 },1000) var chazhi = (timestamp - nowstr)/1000; if (chazhi < 0) { chazhi = 0; } var d = Math.floor(chazhi / 3600 / 24); var h = Math.floor((chazhi / 3600) % 24); var m = Math.floor((chazhi % 3600) / 60); var s = Math.floor((chazhi % 3600) % 60); if (h < 10) { h = "0" + h; } if (m < 10) { m = "0" + m; } if (s < 10) { s = "0" + s; } return d + "天" + h + "时" + m + "分" + s + "秒" }