<!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <script type="text/javascript"> function cal(date){ var ws = ["日", "一", "二", "三", "四", "五", "六"]; var year = date.getFullYear(); var f = new Date(year, 0, 1); var w = date.getDay(); var days = (date.getTime() - f.getTime()) / (1000 * 60 * 60 * 24); var count = parseInt(days / 7) + 1;
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function cal(date){
var ws = ["日", "一", "二", "三", "四", "五", "六"];
var year = date.getFullYear();
var f = new Date(year, 0, 1);
var w = date.getDay();
var days = (date.getTime() - f.getTime()) / (1000 * 60 * 60 * 24);
var count = parseInt(days / 7) + 1;
var msg = date.toLocaleDateString() + " 是 " + year + " 年的第 " + count + " 个星期" + ws[w];
alert(msg);
}window.onload = function(){
cal(new Date());
};
</script>
</head>
<body></body>
</html>
<!--
calendar = new Date();
day = calendar.getDay();
month = calendar.getMonth();
date = calendar.getDate();
year = calendar.getYear();
if (year< 100) year = 1900 + year;
cent = parseInt(year/100);
g = year % 19;
k = parseInt((cent - 17)/25);
i = (cent - parseInt(cent/4) - parseInt((cent - k)/3) + 19*g + 15) % 30;
i = i - parseInt(i/28)*(1 - parseInt(i/28)*parseInt(29/(i+1))*parseInt((21-g)/11));
j = (year + parseInt(year/4) + i + 2 - cent + parseInt(cent/4)) % 7;
l = i - j;
emonth = 3 + parseInt((l + 40)/44);
edate = l + 28 - 31*parseInt((emonth/4));
emonth--;
var dayname = new Array ("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
var monthname =
new Array ("1","2","3","4","5","6","7","8","9","10","11","12" );
document.write(year +"年");
document.write(monthname[month] +"月");
document.write(date +"日" + " <br> ");
document.write(dayname[day] + " ");
if ((month == 6) && (date >= 2)&& (date <= 8)) document.write("第18教学周");
if ((month == 6) && (date >= 9)&& (date <= 15)) document.write("第19教学周");
if ((month == 6) && (date >= 16)&& (date <= 22)) document.write("第20教学周");
if ((month == 6) && (date >= 23)&& (date <= 31)) document.write("暑假愉快!");
if ((month == 7) && (date >= 1)&& (date <= 19)) document.write("暑假愉快!");
if ((month == 7) && (date >= 20)&& (date <= 26)) document.write("第0教学周");
if ((month == 7) && (date >= 27)&& (date <= 31)) document.write("第1教学周");
if ((month == 8) && (date >= 1)&& (date <= 2)) document.write("第1教学周");
if ((month == 8) && (date >= 3)&& (date <=9)) document.write("第2教学周");
if ((month == 8) && (date >= 10)&& (date <= 16)) document.write("第3教学周");
if ((month == 8) && (date >= 17)&& (date <= 23)) document.write("第4教学周");
if ((month == 8) && (date >= 24)&& (date <= 30)) document.write("第5教学周");
if ((month == 9) && (date >= 1)&& (date <= 7)) document.write("国庆长假愉快!");
if ((month == 9) && (date >= 8)&& (date <= 14)) document.write("国庆长假愉快!");
if ((month == 9) && (date >= 15)&& (date <= 21)) document.write("第8教学周");
if ((month == 9) && (date >= 22)&& (date <= 28)) document.write("第9教学周");
if ((month == 9) && (date >= 29)&& (date <= 31)) document.write("第10教学周");
if ((month == 10) && (date >= 1)&& (date <= 4)) document.write("第10教学周");
if ((month == 10) && (date >= 5)&& (date <= 11)) document.write("第11教学周");
if ((month == 10) && (date >= 12)&& (date <= 18)) document.write("第12教学周");
if ((month == 10) && (date >= 19)&& (date <= 25)) document.write("第13教学周");
if ((month == 10) && (date >= 26)&& (date <= 30)) document.write("第14教学周");
if ((month == 11) && (date >= 1)&& (date <= 2)) document.write("第14教学周");
if ((month == 11) && (date >= 3)&& (date <= 9)) document.write("第15教学周");
if ((month == 11) && (date >= 10)&& (date <= 16)) document.write("第16教学周");
if ((month == 11) && (date >= 17)&& (date <= 23)) document.write("第17教学周");
if ((month == 11) && (date >= 24)&& (date <= 30)) document.write("第18教学周");
if ((month == 11) && (date >= 31)&& (date <= 31)) document.write("第19教学周");
if ((month == 0) && (date >= 1)&& (date <= 6)) document.write("第19教学周");
if ((month == 0) && (date >= 7)&& (date <= 13)) document.write("第20教学周");
if ((month == 0) && (date >= 14)&& (date <= 31)) document.write("寒假愉快!");
if ((month == 1) && (date >= 1)&& (date <=24)) document.write("寒假愉快!");
//-->