<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div id="timer">
</div>
<input type="button" value="showTime" οnclick="showTimer()" />
<script type="text/javascript">
function showTimer() {
var mydate = new Date();
//var text = mydate.getFullYear()+"年"+(mydate.getMonth()+1)+"月 " + mydate.getDate()+"日 周" + mydate.getDay();
var text = mydate.toLocaleString();
var div = document.getElementById("timer");
div.innerHTML = text;
setTimeout("showTimer()",1000);
}
window.onload = showTimer();
</script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div id="timer">
</div>
<input type="button" value="showTime" οnclick="showTimer()" />
<script type="text/javascript">
function showTimer() {
var mydate = new Date();
//var text = mydate.getFullYear()+"年"+(mydate.getMonth()+1)+"月 " + mydate.getDate()+"日 周" + mydate.getDay();
var text = mydate.toLocaleString();
var div = document.getElementById("timer");
div.innerHTML = text;
setTimeout("showTimer()",1000);
}
window.onload = showTimer();
</script>
</body>
</html>