Home > Back-end >  Strange! I use DateTimeToUnix and unixtodatetime for calculation, at the same time found there will
Strange! I use DateTimeToUnix and unixtodatetime for calculation, at the same time found there will

Time:11-05

First take the time to date, with converting DateTimeToUnix calendar time (in seconds) second1, then calendar time (in seconds) second1 date1 with unixtodatetime into time, found that error date and date1 probability in 1 second, appeared error, date1 is always big date 1 second, very strange, have prawn encountered this problem? For help!


Procedure TForm1. Button8Click (Sender: TObject);
Var second1 second2: int64;
The date, date1: TDateTime;
Datastr datastr1: string;
The begin
Date:=now;
Edit5. Text:=FormatDateTime (' yyyymmddhhnnss, date);
Second1:=DateTimeToUnix (date);
Date1:=unixtodatetime (second1);
Edit6. Text:=FormatDateTime (' yyyymmddhhnnss, date1);
end;

CodePudding user response:


After the test, it is right,

CodePudding user response:

How many times have you tested, please? I test, will certainly out of 10 times once,

CodePudding user response:

Certainly more than 20 times in a row,

CodePudding user response:

IDE low version?
  • Related