PersianCalendar::IsLeapYear Method (Int32, Int32)


Determines whether the specified year in the specified era is a leap year.

Namespace:   System.Globalization
Assembly:  mscorlib (in mscorlib.dll)

virtual bool IsLeapYear(
	int year,
	int era
) override


Type: System::Int32

An integer from 1 through 9378 that represents the year.

Type: System::Int32

An integer from 0 through 1 that represents the era.

Return Value

Type: System::Boolean

true if the specified year is a leap year; otherwise, false.

Exception Condition

year or era is outside the range supported by this calendar.

Starting with the .NET Framework 4.6, the implementation of the PersianCalendar class has changed from an observational algorithm to the Hijri solar algorithm. As a result, the IsLeapYear method may return different values when run on .NET Framework 4.6 than when run on previous versions of the .NET Framework.

The following code example demonstrates the use of the IsLeapYear method.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0
Available since 5.0
Return to top