NAnt SDK Documentation - v0.92 |

# DateTimeFunctions.GetDaysInMonth Method

Returns the number of days in the specified month of the specified year.

[Visual Basic]
<Function(Name:="get-days-in-month")>
Public Shared Function GetDaysInMonth( _
ByVal year As Integer, _
ByVal month As Integer _
) As Integer
[C#]
[Function(Name="get-days-in-month")]
public static int GetDaysInMonth(
int year,
int month
);

#### Parameters

year
  The year.
month
  The month (a number ranging from 1 to 12).

#### Return Value

The number of days in month for the specified year.

#### Exceptions

Exception Type | Condition
--- | ---
ArgumentOutOfRangeException | month is less than 1 or greater than 12.

#### See Also

DateTimeFunctions Class | NAnt.Core.Functions Namespace