本文介绍了vbscript asp - 查找每个星期四在一个特定的月份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以帮助?
解决方案这是一种方式;
base_date = cdate(2011年8月21日 ) '获得第一个星期四; thurs = dateserial(year(base_date),month(base_date),1) if(weekday(thurs)1)then thurs = 5 - weekday(thurs)+ thurs '循环后续; 直到月(thurs)<> month(base_date) msgbox thurs thurs = dateadd(d,7,thurs) loop
I'm trying to find all Thursdays within a given Month using VBScript.
Can anyone help?
解决方案Here is one way;
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
更多推荐
vbscript asp
发布评论