<script>
var dateThe = new Date()
function loveTime() {
var date=dateThe - new Date().setDate(new Date().getDate() -3) ;
console.log(date)
var days = Math.floor(date / 1000 / 60 / 60 / 24) // 从这里开始
var daysmod = date - days * 24 *60 * 60 * 1000
var hours = Math.floor(daysmod / 1000 / 60 / 60)
var hoursmod = date - (days * 24 *60 * 60 * 1000) - (hours * 1000 * 60 * 60)
var minutes = Math.floor(hoursmod / 1000 / 60)
var minutesmod = date - (days * 24 *60 * 60 * 1000) - (hours * 1000 * 60 * 60) - (minutes * 1000 * 60)
var seconds = Math.floor(minutesmod / 1000) // 到这里结束,是将总毫秒转化成对应天数+小时数+分钟数+秒数的转换方法
$('#day').text(days);
$('#hour').text(hours);
$('#min').text(minutes);
$('#ss').text(seconds);
}
$(function () {
setInterval("loveTime()",1000);
})
</script>