<%'聲明,程式規啊堅所有@
function wr(str)
response.Write(str)
end function
thedate=date()
function ljj_days()'本月的天數
ljj_days=DateDiff("d",year(thedate)&"-"&month(thedate)&"-1",DateAdd("m",1,CDate(year(thedate)&"-"&month(thedate)&"-1")))
end function
function firstweek(y,m)'一日的周次
firstweek=Weekday(DateSerial(y,m, 1))
end function
%>
<%'初始化數組
dim arrays(7,7)
dim tem
tem=1
ds=date()
fir=firstweek(year(ds),month(ds))
for i=0 to 4
if i=0 then
for j=fir-1 to 6
arrays(i,j)=tem
tem=tem+1
next
else
for j=0 to 6
arrays(i,j)=tem
tem=tem+1
if tem=31 then
exit for
end if
next
end if
if tem=31 then
exit for
end if
next
%>
<%
dim ljj_date
ljj_date=date()
dim i
wr("<p align=center>"&year(ljj_date)&"年"&month(ljj_date)&"月</p>")
wr("<hr>")'這裡是一條橫線
for i=1 to 7
wr("<table border='1' align=center>")
wr("<tr>")
if i=1 then '這裡先輸出星期,表頭,啊堅工作室
wr("<td>星期日</td>")
wr("<td>星期一</td>")
wr("<td>星期二</td>")
wr("<td>星期三</td>")
wr("<td>星期四</td>")
wr("<td>星期五</td>")
wr("<td>星期六</td>")
else
for j=1 to 7
if day(ljj_date)=arrays(i-2,j-1) then
wr("<td width=48 style=color:red>")
wr(arrays(i-2,j-1))
wr("</td>")
else
wr("<td width=48 >")
wr(arrays(i-2,j-1))
wr("</td>")
end if
next
end if
wr("</tr>")
next
%>