<html>
<head>
<title>显示停留时间</title>
<script language="javascript">
<!--
startTime = new Date();
function showTime() {
nowTime = new Date();
var diffTime = nowTime.getTime() - startTime.getTime();
seondsCount = Math.round(diffTime/1000)
diffHours = Math.round(seondsCount/(60*60));
diffMinutes = Math.round((seondsCount-30)/60);
diffSeconds = seondsCount%60
showTimes = diffHours + "时" + diffMinutes + "分" + diffSeconds + "秒";
show.innerHTML = showTimes;
setTimeout("showTime()", 1000);
}
//-->
</script>
</head>
<body onload="showTime()">
<div id="show"></div>
</body>
</html>
浙公网安备 33010602011771号