RAD Studio 10.2.3 测试√
procedure TForm_Tips.Button_ComDateTimeClick(Sender: TObject);
var
mTime1, mTime2: TDateTime;
mDay: Integer;
begin
mTime1 := Now;
mTime2 := VarToDateTime('2021-06-01 08:00:00');
Memo_Log.Lines.Add(FormatDatetime('YYYY:MM:DD HH:MM:SS',mTime2));
mDay := DaysBetween(mTime1, mTime2);
Memo_Log.Lines.Add(IntToStr(mDay) + '天');
end;
一点点笔记,以便以后翻阅。