procedure TForm1.Button1Click(Sender: TObject); var a:integer; temp1,temp2:string; begin a:=strtoint(edit1.Text); temp1:=inttostr(a div 60); temp2:=inttostr(a mod 60); if temp2='0' then temp2:='00'; label1.Caption:=temp1+':'+temp2; end; ////
select convert(char(8), cast(convert(char(8), dateadd(minute,130,getdate()),108) as datetime)-cast( convert(char(8),getdate(),108) as datetime) ,108)
var
a:integer;
temp1,temp2:string;
begin
a:=strtoint(edit1.Text);
temp1:=inttostr(a div 60);
temp2:=inttostr(a mod 60);
if temp2='0' then temp2:='00';
label1.Caption:=temp1+':'+temp2;
end;
////
convert(char(8),
cast(convert(char(8), dateadd(minute,130,getdate()),108) as datetime)-cast( convert(char(8),getdate(),108) as datetime)
,108)
是Delphi社区,我还以为是SQL SERVER,俺用delphi试试
130 div 60:=分
130/60:=秒