Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
IsLeapYear Method (Int32, Int32)
Collapse the table of content
Expand the table of content

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)

abstract IsLeapYear : 
        year:int * 
        era:int -> bool  
override IsLeapYear : 
        year:int * 
        era:int -> bool

Parameters

year
Type: System.Int32

An integer from 1 through 9378 that represents the year.

era
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.

ExceptionCondition
ArgumentOutOfRangeException

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft