首页 > 网站 > 建站经验 > 正文

asp制作的日-历程序

2019-11-02 15:14:51
字体:
来源:转载
供稿:网友

 纯ASP打造的日历程序,可自行美化,这里仅提供最简单的CSS样式。。。

<style>
body{font-size:12px; margin:20px 0 0 20px; padding:0}
tr,td{text-align:center;}
</style>
<%
'=================================
'说明:日历文件
'=================================
'取出对应的年月博客日志数据
'=======================
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 = "<a href='calendar.asp?year="&nowyear - 1&"&month="&nowmonth&"'> &lt;&lt;</a>&nbsp;"
willshowmonthmonth = nowmonth
If willshowmonthmonth - 1 <= 0 Then willshowmonthmonth = 2
calendar = calendar & "<a href='calendar.asp?year="&nowyear&"&month="&willshowmonthmonth - 1&"'> &lt;</a>&nbsp;"
If willshowmonthmonth + 1 > 12 Then willshowmonthmonth = 11
calendar = calendar & "<a href='calendar.asp?year="&nowyear&"&month="&willshowmonthmonth + 1&"''> &gt;</a>&nbsp;"
calendar = calendar & "<a href='calendar.asp?year="&nowyear + 1&"&month="&nowmonth&"'> &gt;&gt;</a>&nbsp;"
calendar = calendar & "<table bgcolor=#000000 cellspacing=1 width=200><tr bgcolor=#ffffff><td colspan=7>"&nowyear&"-"&nowmonth&"-"&day(now)&"</td></tr>"&VBCRLF
calendar = calendar & " <tr bgcolor=#ffffff>"&VBCRLF
calendar = calendar & "<td>日</td>"&VBCRLF
calendar = calendar & "<td>一</td>"&VBCRLF
calendar = calendar & "<td>二</td>"&VBCRLF

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表