.GetMonthsInYear Method (Int32, Int32)
.NET Framework 4.6 and 4.5
When overridden in a derived class, returns the number of months in the specified year in the specified era.
public abstract int GetMonthsInYear(
Parameters year Type: System .Int32
An integer that represents the year.
era Type: System .Int32
An integer that represents the era.
System .Int32 The number of months in the specified year in the specified era.
Exception Condition ArgumentOutOfRangeException year is outside the range supported by the calendar.
era is outside the range supported by the calendar.
For example, in
, HebrewCalendar returns 12 for a common year or 13 for a leap year. GetMonthsInYear Notes to Inheritors
The derived class must support
when it is passed as the CurrentEra era parameter. One way to support is by replacing it with the value stored in CurrentEra Eras, which is the value for the current era of the calendar. .NET Framework
Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
.NET Framework Client Profile
Supported in: 4, 3.5 SP1
Supported in: 3.0, 2.0, 1.0
.NET for Windows Phone apps
Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8
Portable Class Library
Supported in: Portable Class Library