getDaysInMonth

Gets number of days in a certain month

CodeFunctionName
What is this?

Public

Tested

Original Work
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 4,785

Downloads 1,572

CodeID
DB ID