|
|
#2
stars_chen2007-03-14 17:24
|
var
Form1: TForm1;
year,month,day:word;
date:tdate;
s1,s2:string;
implementation
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
begin
date:=now;
decodedate(date,year,month,day);
edit1.Text:=inttostr(year);
edit2.Text:=inttostr(month);
edit3.Text:=inttostr(day);
{if month<10 then
s1:=inttostr(year)+'0'+inttostr(month)
else
s1:=inttostr(year)+inttostr(month);
if day<10 then
s2:=s1+'0'+inttostr(day)
else
s2:=s1+inttostr(day);
edit4.Text:=s2;}
end;
end;
end.
带括号部分怎么样才可以简化一样用encodedate是不是可以完成输出当前日期.