getDaysInMonth

Gets number of days in a certain month

Function getDaysInMonth(strMonth, strYear)
 Dim strDays 
 strDays = 31 ' Assuming month is 1,3,5,7,8,10,12
 Select Case cint(strMonth)
 Case 4,6,9,11 ' if not
  strDays = 30
 Case 2
  strDays = 28
  if ( (cint(strYear) mod 4 = 0 and cint(strYear) mod 100 <> 0) or ( cint(strYear) mod 400 = 0) ) Then strDays = 29
 End Select
 getDaysInMonth = strDays
End Function

strMonth, strYear

Views 478 Downloads 156

'No of days', 'Number', 'days', 'leap year', 'month', 'year'

DevinGarlit
4
Date+Time Classic ASP
Revisions

v1.0