delphi IsLeapYear、IsInLeapYear - 是否是闰年


本文整理自网络,侵删。

 IsLeapYear、IsInLeapYear - 是否是闰年
SysUtils.IsLeapYear();
DateUtils.IsInLeapYear();
--------------------------------------------------------------------------------


unit Unit1;

interface

uses
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 ioutils 单元(6): tpath(结构体)路径的提取和处理

Delphi中的进制转换

Delphi tfilestream 的读写 合并文件

Delphi关闭进程

Delphi idftp 错误:socket error 10054 �c connection reset by peer -连接被重置

Delphi2009之timage

Delphi中判断操作系统是否是windows7

Delphi延时4种方法

Delphi idhttp post中文的问题

Delphi dbgrid支持鼠标滚轮浏览数据

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



打赏

取消

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

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

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

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

评论

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