首页 > 其他 > 详细

System.DateUtils 2. IsInLeapYear 判断是否是闰年

时间:2015-08-26 11:54:51      阅读:219      评论:0      收藏:0      [点我收藏+]

编译版本: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;

System.DateUtils 2. IsInLeapYear 判断是否是闰年

原文:http://www.cnblogs.com/BlackList-Sakura/p/4759922.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!