<SCRIPT LANGUAGE="VBScript">
Function getLastDay1(theDate)
Dim nextM
nextM = CDate(Year(theDate) & "-" & (Month(theDate)+1) & "-1")
getLastDay1 = Day(DateAdd("d",-1,nextM))
End Function
MsgBox getLastDay1(Date)
Function getLastDay2(theDate)
Dim nextM,D
D = 31
While Month(nextM) = Month(theDate)
nextM = CDate(Year(theDate) & "-" & Month(theDate) & "-" & D)
D = D - 1
Wend
getLastDay2 = D
End Function
MsgBox getLastDay2(Date)
</SCRIPT>
<%
function getdays(y,m)
dim isrn
select case m
case 1,3,5,7,8,10,12
getdays=31
exit function
case 4,6,9,11
getdays=30
exit function
case 2
''''''''''''''''''''判断是否为闰年''''''''''''''''''''''
if y mod 4=0 and y mod 100>0 or y mod 400=0 then
isrn=true
else
isrn=false
end if
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if isrn=true then getdays=29 else getdays=28
exit function
case else
getdays=0
end select
end function
%>