Mono Class Library: System.DateTime Overview | Members

System.DateTime.DaysInMonth Method

Returns the number of days in a specified month of a specified year. [Edit]

public static int DaysInMonth (int year, int month)

Parameters

year
A int containing the year. [Edit]
month
The month (a int between 1 and 12). [Edit]

Returns

A int set to the number of days in the specified month for the specified year. If the specified month is February, the return value is 28 or 29 depending upon whether the specified year is a leap year. [Edit]

Exceptions

TypeReason
ArgumentOutOfRangeExceptionmonth is less than 1 or greater than 12. [Edit]

Remarks

Documentation for this section has not yet been entered. [Edit]

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0