delphi 是否是闰年- IsLeapYear、IsInLeapYear


本文整理自网络,侵删。

 

SysUtils.IsLeapYear();
DateUtils.IsInLeapYear();

unit Unit1;interfaceuses  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  Dialogs, StdCtrls;

type  TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
end;

var  Form1: TForm1;
implementation
{$R *.dfm}
uses DateUtils;
procedure TForm1.FormCreate(Sender: TObject);
var  b: Boolean;begin 
b := IsLeapYear(2009); //False 
b := IsLeapYear(2012); //True 
b := IsInLeapYear(StrToDateTime('2009-1-1')); //False 
b := IsInLeapYear(StrToDateTime('2012-1-1')); //True// 
ShowMessage(BoolToStr(b, True));
end;
end.

相关阅读 >>

Delphi zlib 流压缩解压

Delphi的tstreamreader逐行读取文本文件

Delphi 改变进程优先级

Delphi中安装和使用kol和mck

Delphi windows 根据进程名结束进程的代码

Delphi里树形菜单的实现

Delphi webbrowser有关技术

Delphi 获取系统mydocuments文件夹路径

Delphi xe5 使用 android 内置函数几个小测试

Delphi 判断字符是否是数字

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...