<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Tangerine">
<style>
h1 {
font-size: 70px;
}
.div1 {
margin: 0 auto;
width: 1600px;
height: 1200px;
text-align: center;
line-height: 700px;
}
</style>
<script>
setInterval(function() {
/* var date1 = '2017/08/16 20:00:00';
var date2 = new Date(); */
var date2 = '2023/01/21 23:59:59';
var date1 = new Date();
var date3 = date1.getTime() - new Date(date2).getTime();
var days = Math.floor(date3 / (24 * 3600 * 1000));
var leave1 = date3 % (24 * 3600 * 1000);
var hours = Math.floor(leave1 / (3600 * 1000));
var leave2 = leave1 % (3600 * 1000);
var minutes = Math.floor(leave2 / (60 * 1000));
var leave3 = leave2 % (60 * 1000);
var seconds = Math.round(leave3 / 1000);
document.getElementById('h11').innerHTML = days + '天' + hours + '时'
+ minutes + '分' + seconds + '秒';
}, 1000)
</script>
</head>
<body>
<div class="div1">
<h1 id="h11"></h1>
</div>
</body>
</html>
不刷新倒计时
最新推荐文章于 2020-06-22 09:59:47 发布