# Function Reference

# _DateDaysInMonth

Returns the number of days in a month, based on the specified month and year

#include <Date.au3>
_DateDaysInMonth ( $iYear, $iMonthNum )

## Parameters

$iYear | 4-digit year.
$iMonthNum | Month number (1 = January, 12 = December).

## Return Value

Success: | the number of days in the month.
Failure: | 0 and sets the @error flag to non-zero.
@error: | 1 - Invalid month number or year.

## Related

_DateDayOfWeek

## Example

    #include <Date.au3>
    #include <MsgBoxConstants.au3>

    Local $iDays = _DateDaysInMonth(@YEAR, @MON)
    MsgBox($MB_SYSTEMMODAL, "Days in Month", "This month has " & String($iDays) & " days in it.")