JulianCalendar.IsLeapYear Method (Int32, Int32)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

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

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

Parameters

year
Type: System.Int32

An integer that represents the year.

era
Type: System.Int32

An integer that represents the era.

Return Value

Type: System.Boolean

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

Exception Condition
ArgumentOutOfRangeException

year is outside the range supported by the calendar.

-or-

era is outside the range supported by the calendar.

Unlike the Gregorian calendar, the Julian calendar defines a leap year as a year that is evenly divisible by four with no exceptions. Therefore, the calendar is inaccurate by one day every 128 years. For example, the year 1999 was not a leap year, but the year 2000 was. A common year has 365 days and a leap year has 366 days.

The following example calls IsLeapYear for five years in each of the eras.

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

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Return to top
Show: