首页 > 代码库 > 时间转换

时间转换

 
procedure TForm1.FormCreate(Sender: TObject);
begin
    edtHour.Clear;
    edtMinutes.Clear;
    edtHs.Clear;
    edtSec.Clear;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
try
   if edtHour.Text<>‘‘    then edtMinutes.Text:= IntToStr(strtoint(edtHour.Text)*60);
   if edtMinutes.Text<>‘‘ then edtSec.Text:= IntToStr(strtoint(edtMinutes.Text)*60);
   if edtSec.Text<>‘‘     then edtHs.Text:= IntToStr(strtoint(edtSec.Text)*1000);

    Self.Caption:=‘Form1‘;
except
    Self.Caption:=‘数据输入错误‘;
end;
end;


来自为知笔记(Wiz)