2014年2月23日 星期日

asp-default-date datefrom dateto asp monthone monthend mthend mthone

dim thisYear
thisYear=year(now) 
months=year(now)*12+month(now)-1
defaultyear=int(months/12)
defaultmonth=months mod 12
defaultdayfrom=1
if defaultmonth=1 or defaultmonth=3  or defaultmonth=5  or defaultmonth=7  or defaultmonth=8  or defaultmonth=10  or defaultmonth=12 then
defaultdayto=31
elseif defaultmonth=4 or defaultmonth=6  or defaultmonth=9  or defaultmonth=11 then
defaultdayto=30
else
if 0 = defaultYear Mod 4 then
defaultdayto=28
else 
defaultdayto=29
end if 
end if 

沒有留言:

張貼留言