<head>
<title></title>
<script type="text/javascript">
function GetTime() {
var time = new Date();
var year = time
var month = time
var day = time
var hour = time
var minute = time
var sec = time
var timestring;
if (minute <
timestring
= year + "
}
else {
timestring
= year + "
}
// div沒有value屬性
document
window
}
</script>
</head>
<body onload="GetTime()">
<div id="timeDiv">
</div>
</body>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20158.html