IsLeapDay
Checks if the current day is a leap day
Source
public static Boolean IsLeapDay(this DateTime date)
{
return(date.Month == 2 && date.Day == 29);
}
Example
Boolean isLeapDay = new DateTime(2012, 2, 29).IsLeapDay();
ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods
Checks if the current day is a leap day
public static Boolean IsLeapDay(this DateTime date)
{
return(date.Month == 2 && date.Day == 29);
}
Boolean isLeapDay = new DateTime(2012, 2, 29).IsLeapDay();