| 
| 技术资料  > ASP技术 > ASP应用 : 计算当前日期是任意时间段内第几周的函数 |  
计算当前日期是任意时间段内第几周的函数 March 25,2004 |  
前几天我问过,今天写出来了!! 
Function CalculateWeekNo(BeginDate,EndDate,InputDate) 
dim wdate(500,8) 
z=0 
x=0 
strlong=len(CStr(inputdate))-9 
inputdate=cdate(left(CStr(inputdate),strlong)) 
for i=cdate(BeginDate) to cdate(EndDate) 
    if inputdate=i then 
    x=z 
    Exit For 
    end if 
    if weekday(i)=7 then 
    z=z+1 
    end if     
next 
 
CalculateWeekNo=x 
end Function 
         |  
 
 | 
  
Copyright © 2001-2008 Shenzhen Hiblue Software Team All rights reserved