vbscript asp - 查找给定月份的每个星期四

Cla*_*ear 2 vbscript date

我试图使用VBScript查找给定月份内的所有星期四.

有人可以帮忙吗?

Ale*_* K. 5

这是一种方式;

base_date = cdate("21 aug 2011")

'get 1st thursday;
thurs = dateserial(year(base_date), month(base_date), 1)
if (weekday(thurs) <> 1) then thurs = 5 - weekday(thurs) + thurs

'loop subsequent;
do until month(thurs) <> month(base_date)
    msgbox thurs
    thurs = dateadd("d", 7, thurs)
loop
Run Code Online (Sandbox Code Playgroud)