System.Globalization.Calendar.GetDaysInMonth Method

Returns the number of days in the specified month and year of the current era.

Syntax

public virtual int GetDaysInMonth (int year, int month)

Parameters

year
An integer that represents the year.
month
A positive integer that represents the month.

Returns

The number of days in the specified month in the specified year in the current era.

Remarks

For example, in System.Globalization.GregorianCalendar, Calendar.GetDaysInMonth(int, int) for February returns 28 in a common year or 29 in a leap year.

Requirements

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