ASP日历 实现遍历数据库取出对应的年月日数据
作者:互联网
2009-06-23
<" CODEPAGE="65001"%>
<%
response.charset = "UTF-8"
session.codepage = 65001
session.timeout = 1440
server.scripttimeout = 9999
%>
<%
'=================================
'说明:日历文件
'=================================
'取出对应的年月日数据
'=======================
Ryear = CInt(request.querystring("year"))
Rmonth = CInt(request.querystring("month"))
If Ryear = 0 or Ryear = NULL Then Ryear = year(now)
If Rmonth = 0 or Rmonth = NULL Then Rmonth = month(now)
nowtime = Ryear&"-"&Rmonth&"-1" '得到本月第一天
nowyear = year(nowtime) '年份
nowmonth = month(nowtime) '月份
nowweekday = weekday(nowtime) - 1 '当前礼拜
'获取2月天数
febdays = 28
If nowyear / 4 = 0 Then febdays = 29
'获取本月天数
If nowmonth = 1 then
monthdays = 31
ElseIf nowmonth = 2 Then
monthdays = febdays
ElseIf nowmonth = 3 Then
monthdays = 31
ElseIf nowmonth = 4 Then
monthdays = 30
ElseIf nowmonth = 5 Then
monthdays = 31
ElseIf nowmonth = 6 Then
monthdays = 30
ElseIf nowmonth = 7 Then
monthdays = 31
ElseIf nowmonth = 8 Then
monthdays = 31
ElseIf nowmonth = 9 Then
monthdays = 30
ElseIf nowmonth = 10 Then
monthdays = 31
ElseIf nowmonth = 11 Then
monthdays = 30
Else
monthdays = 31
End If
calendar = " << "
willshowmonthmonth = nowmonth
If willshowmonthmonth - 1 <= 0 Then willshowmonthmonth = 2
calendar = calendar & " < "
If willshowmonthmonth + 1 > 12 Then willshowmonthmonth = 11
calendar = calendar & " > "
calendar = calendar & " >> "
calendar = calendar & "
| "&nowyear&"-"&nowmonth&"-"&day(now)&" | ||||||
| 日 | "&VBCRLF一 | "&VBCRLF二 | "&VBCRLF三 | "&VBCRLF四 | "&VBCRLF五 | "&VBCRLF六 | "&VBCRLF
| "&VBCRLF | "&i&" | "&VBCRLF"&i&" | "&VBCRLF||||
| "&VBCRLF | ||||||
Response.Write calendar
%>
相关标签:
ASP
相关推荐
