ASP实现连续显示两周的时间和星期
类别: ASP教程
<% xztime=date
if weekday(xztime)=1 then xztime=DateAdd("d", -6, xztime)
if weekday(xztime)=2 then xztime=xztime
if weekday(xztime)=3 then xztime=DateAdd("d", -1, xztime)
if weekday(xztime)=4 then xztime=DateAdd("d", -2, xztime)
if weekday(xztime)=5 then xztime=DateAdd("d", -3, xztime)
if weekday(xztime)=6 then xztime=DateAdd("d", -4, xztime)
if weekday(xztime)=7 then xztime=DateAdd("d", -5, xztime)
for j=1 to 14
id= weekday(xztime)
select case id
case 2 dd="星期一"
case 3 dd="星期二"
case 4 dd="星期三"
case 5 dd="星期四"
case 6 dd="星期五"
case 7 dd="星期六"
case else dd="星期日"
end select
response.Write(year(xztime)&"年"&month(xztime)&"月"&day(xztime)&"日" &dd&"<br>")
xztime= DateAdd("d", 1, xztime)
next
%>
if weekday(xztime)=1 then xztime=DateAdd("d", -6, xztime)
if weekday(xztime)=2 then xztime=xztime
if weekday(xztime)=3 then xztime=DateAdd("d", -1, xztime)
if weekday(xztime)=4 then xztime=DateAdd("d", -2, xztime)
if weekday(xztime)=5 then xztime=DateAdd("d", -3, xztime)
if weekday(xztime)=6 then xztime=DateAdd("d", -4, xztime)
if weekday(xztime)=7 then xztime=DateAdd("d", -5, xztime)
for j=1 to 14
id= weekday(xztime)
select case id
case 2 dd="星期一"
case 3 dd="星期二"
case 4 dd="星期三"
case 5 dd="星期四"
case 6 dd="星期五"
case 7 dd="星期六"
case else dd="星期日"
end select
response.Write(year(xztime)&"年"&month(xztime)&"月"&day(xztime)&"日" &dd&"<br>")
xztime= DateAdd("d", 1, xztime)
next
%>
- 上一篇: ASP存储过程使用大全
- 下一篇: 连接数据库常用的连接字符串
-= 资 源 教 程 =-
文 章 搜 索