函数可以自动给星期套上从当天起的未来日期数,调用方式如下:
星期一:<%=getWeek(1)%>
星期二:<%=getWeek(2)%>
星期三:<%=getWeek(3)%>
星期四:<%=getWeek(4)%>
以下是引用片段: Function getWeek(w) '原创:阿里西西 '网址:www.alixixi.com '日期:2009-1-18 dim w1,w2,w3,w4,w5,w6,w7 dim d1,d2,d3,d4,d5,d6,d7 d1 = day(now()) w1 = weekday(now()) if w1 = w then getWeek = d1 d2 = day(now()+1) w2 = weekday(now()+1) if w2 = w then getWeek = d2 d3 = day(now()+2) w3 = weekday(now()+2) if w3 = w then getWeek = d3 d4 = day(now()+3) w4 = weekday(now()+3) if w4 = w then getWeek = d4 d5 = day(now()+4) w5 = weekday(now()+4) if w5 = w then getWeek = d5 d6 = day(now()+5) w6 = weekday(now()+5) if w6 = w then getWeek = d6 d7 = day(now()+6) w7 = weekday(now()+6) if w7 = w then getWeek = d7 End Function |
时间: 2024-11-03 23:04:26