<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<script>
var now = new date;
var bir = new date(1995,09,24,08,50,10); //在这里按照这个格式输入自己生日:年月日时分秒
console.log(bir.gettime() + '<br>');
console.log(now.gettime() + '<br>');
var cha = now - bir;
console.log(cha + '<br>')
var date = cha / 86400000;
document.write('出生到现在你已经生活了' + parseint(date) + '天零');
var hours1 = (cha % 86400000) / 3600000;
document.write(parseint(hours1) + '小时零');
var minutes1 = (cha % 86400000 % 3600000) / 60000;
document.write(parseint(minutes1) + '分钟零');
var second1 = (cha % 86400000 % 3600000 % 60000)/ 1000;
document.write(parseint(second1) + '秒');
</script>
<title>document</title>
</head>
<body>
</body>
</html>
网友评论