编程:打开页面显示系统时间,效果如图
<html>
<head>
<script type="text/javascript">
function m1(){
var now = new Date();
var year = now.getFullYear();
var month = now.getMonth() + 1;
var date = now.getDate();
var day = now.getDay();
var hh = now.getHours();
var mm = now.getMinutes();
var sec = now.getSeconds();
var arrWeek=new Array("日", "一", "二", "三", "四", "五", "六");
var week = arrWeek[day];
alert(year + "年" + month + "月" + date + "日" + "星期" + week + " " + hh + "时" + mm + "分"+ sec + "秒");
}
</script>
</head>
<body onload="m1()">
</body>
</html>