<-- Previous || Up || Next -->

Is Leap Year Function
Dates Times Class

Public Function IsLeapYear( _
    ByVal vDate As Variant _
    ) As Variant

Return true if the year is a leap year, meaning that it has 29 days in February and 366 days altogether.

Examples:
    IsLeapYear(1996) = True
    IsLeapYear(#2/5/1996#) = True
    IsLeapYear(2000) = True
    IsLeapYear(2001) = False
    IsLeapYear(#2/5/2001#) = False
See also:
    DaysInMonth Function
    DaysInYear Function
    IsLeapYearTest Function
vDate: The date or year number which is checked to see if it is a "leap year." Function examines the year component of the date if vDate is a date value. Function interprets numeric values as years instead of interpreting them as a date. Function returns Null if vDate is Null or cannot be fixed up to either a date or a number.
Definition: Post-1752 years: Leap years are those that are either 1) divisible by 4 and not divisible by 100, or 2) divisible by 400. Pre-1752 years: Leap years are those that are divisible by 4.
Note: Microsoft Visual Basic applies the post-1752 formula to all years to determine if they are leap years.
v1.1 BugFix: Changed this function to correctly consider certain pre-1752 years (100, 200, 300, 500, 600, 700, 900, 1000, 1100, 1300, 1400, 1500, 1700) to be leap years.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.