L
lichengbin
Unregistered / Unconfirmed
GUEST, unregistred user!
如题!
另外,还想问问大家,为什么Trunc(A * SecsPerDay)和DateTimeToTimeStamp(A).Time div 1000的值会有误差呢?
procedure TForm1.N2Click(Sender: TObject);
var
A: TDateTime;
begin
A := StrToDateTime('2005-07-19 16:16:00');
Memo1.Lines.Add('时间:' + DateTimeToStr(A));
Memo1.Lines.Add('Trunc(A * SecsPerDay) = ' + IntToStr(Trunc(Frac(A) * SecsPerDay)));
Memo1.Lines.Add('DateTimeToTimeStamp(A).Time = ' + IntToStr(DateTimeToTimeStamp(A).Time div 1000));
end;
另外,还想问问大家,为什么Trunc(A * SecsPerDay)和DateTimeToTimeStamp(A).Time div 1000的值会有误差呢?
procedure TForm1.N2Click(Sender: TObject);
var
A: TDateTime;
begin
A := StrToDateTime('2005-07-19 16:16:00');
Memo1.Lines.Add('时间:' + DateTimeToStr(A));
Memo1.Lines.Add('Trunc(A * SecsPerDay) = ' + IntToStr(Trunc(Frac(A) * SecsPerDay)));
Memo1.Lines.Add('DateTimeToTimeStamp(A).Time = ' + IntToStr(DateTimeToTimeStamp(A).Time div 1000));
end;