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 xe2和xe3开发的程序中加入管理员权限申请

Delphi xe中使用tchart绘制平滑曲线

Delphi 删除memo某一行

Delphi 获取当前进程的父进程

Delphi 系统日期时间格式设置

Delphi实现抓屏压缩并保存桌面图片

Delphi 如何遍历整个硬盘的各个目录,就像windows的查找功能那样

indy 中idhttp元件出现http status 302错误

Delphi winapi: getmodulefilename、getmodulehandle

关于Delphi xe2的fmx的一点点研究之消息篇

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



打赏

取消

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

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

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

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

评论

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