<html>
<head><title>Calendar</title>
<script>
var todayDate = new Date();
var date = todayDate.getDate();
var month = todayDate.getMonth()+1;
var year = todayDate.getFullYear();
var weeks = [
"星期日","星期一","星期二","星期三","星期四","星期五","星期六"
];
document.write("今天是");
document.write("<br/>");
document.write(year);
document.write("年");
document.write(month);
document.write("月");
document.write(date);
document.write("日");
document.write("<br/>");
document.write(weeks[todayDate.getDay()]);
</script>
</head>
<body>
</body>
</html>
练习用简单的日历

最新推荐文章于 2023-02-14 13:35:01 发布