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.
DateUtils-Function
總結
以上是生活随笔為你收集整理的IsLeapYear、IsInLeapYear 是否是闰年的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: form 源码刨析
- 下一篇: LIS路径记录(UVA481)