| ASP简单日历程序
					当前位置:点晴教程→知识管理交流
					
					→『 技术文档交流 』
					
				 
  [br]<% [br]y=request.querystring("y")  [br]m=request.querystring("m")  [br]d=request.querystring("d") [br][br]if y="" then [br]    y=year(date) [br]    m=month(date) [br]    d=day(date) [br]end if [br][br]call blogdate(y,m,d) [br][br]'=====================以年月日为参数的显示============================================== [br]sub blogdate(y,m,d)   ' [br]str1="   当前的日期是"&y&"年"&m&"月"&d&"日   "   '得到当前日期的年月日 [br]nowdate=y&"-"&m&"-"&d [br]lastdate=dateadd("m",-1,nowdate) [br]lasty=year(lastdate) [br]lastm=month(lastdate) [br]nextdate=dateadd("m",1,nowdate) [br]nexty=year(nextdate) [br]nextm=month(nextdate) [br]str1=str1&"上一月 "  [br]str1=str1&"下一月 "  [br]str1=str1&"返回今日" [br]response.write str1 [br]thismonth=y&"-"&m&"-1"    '当前月的第一天 [br]nextmonth=dateadd("m",1,thismonth)  '下个月的第一天 [br]num=datediff("d",thismonth,nextmonth)  '当前月的天数 [br]firstday=weekday(thismonth)-1   '得到当前月第一天的星期 [br]'call displaydate(firstday,num) [br]response.write " 
 [code] <% y=request.querystring("y") m=request.querystring("m") d=request.querystring("d") if y="" then y=year(date) m=month(date) d=day(date) end if call blogdate(y,m,d) '=====================以年月日为参数的显示============================================== sub blogdate(y,m,d) ' str1=" 当前的日期是"&y&"年"&m&"月"&d&"日 " '得到当前日期的年月日 nowdate=y&"-"&m&"-"&d lastdate=dateadd("m",-1,nowdate) lasty=year(lastdate) lastm=month(lastdate) nextdate=dateadd("m",1,nowdate) nexty=year(nextdate) nextm=month(nextdate) str1=str1&"上一月 " str1=str1&"下一月 " str1=str1&"返回今日" response.write str1 thismonth=y&"-"&m&"-1" '当前月的第一天 nextmonth=dateadd("m",1,thismonth) '下个月的第一天 num=datediff("d",thismonth,nextmonth) '当前月的天数 firstday=weekday(thismonth)-1 '得到当前月第一天的星期 'call displaydate(firstday,num) response.write " 
 end sub '=================================================================== %> [/code] 该文章在 2010/7/22 10:55:31 编辑过 | 关键字查询 相关文章 正在查询... |