相减的结果
function DiffTimeToSec ( const DS , DE : TDateTime ): integer ;
const
SCALE = 24 * 60 * 60 ;
begin
Result := Round (( DE - DS )* SCALE );
end ;
试一试以下代码:
procedure TForm1.Button1Click(Sender: TObject);
var
dtr,dts,dte : TDateTime;
min : double;
begin
dts :=strtodatetime('2000-11-9 12:30');
dte :=strtodatetime('2000-11-9 11:30');
dtr :=dte-dts;
min :=dtr*24*60*60;
showmessage(floattostr(min))
end;