System.DateTime.IsLeapYear Method

Returns an indication whether the specified year is a leap year.

Syntax

public static bool IsLeapYear (int year)

Parameters

year
A 4-digit year.

Returns

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

Remarks

year is specified as a 4-digit base 10 number; for example, 1996.

year is always interpreted as a year in the Gregorian calendar. To determine whether a particular year was a leap year in some other calendar, call that calendar object's IsLeapYear method.

Requirements

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