1
2function getdays(theyear,theweek)
3dim theday,day1,firstday,lastday
4theday=cdate(theyear&"-1-1")
5day1=weekday(theday,vbMonday)
6if theweek=1 then
7firstday=theday
8lastday=dateadd("d",7-day1,firstday)
9else
10firstday=dateadd("ww",theweek-2,dateadd("d",8-day1,theday))
11lastday=dateadd("d",6,firstday)
12end if
13getdays=firstday&","&lastday
14end function
15
16response.write getdays(2004,2)
如何得到某年某周的具体日期(几月几日至几月几日)
comments powered by Disqus