编译版本:Delphi XE7

function IsInLeapYear(const AValue: TDateTime): Boolean;

implementation

// 判断是否是闰年

function IsInLeapYear(const AValue: TDateTime): Boolean;
begin
  Result := IsLeapYear(YearOf(AValue));
end;

// 是否是闰年,引用单元 System.SysUtils

function IsLeapYear(Year: Word): Boolean;
begin
  Result := (Year mod 4 = 0) and ((Year mod 100 <> 0) or (Year mod 400 = 0)); // 此处为老生常谈,不再赘述
end;

05-07 09:36