本文整理自网络,侵删。
Yesterday、Today、Tomorrow - 昨天、今天、明天
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses DateUtils;
procedure TForm1.FormCreate(Sender: TObject);
var
t1,t2,t3: TDateTime;
begin
t1 := Yesterday;
t2 := Today; //同 SysUtils.Date;
t3 := Tomorrow;
ShowMessageFmt('%s, %s, %s', [DateToStr(t1), DateToStr(t2), DateToStr(t3)]);
{2009-5-20, 2009-5-21, 2009-5-22}
end;
end.
相关阅读 >>
Delphi 判断指定字符串是否开头 startstext用法
Delphi idhttp中设置非标准头信息和读写cookie
Delphi 2009 中 string 与 char 的改变
更多相关阅读请进入《Delphi》频道 >>