Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin
edit1.Text := intToStr(secondsBetween(dateTime2Utc(incDay(now,1)), encodeDate(1970,1,1)));
end;
--> morgen um diese Zeit
Delphi-Quellcode:
TimeStart := secondsBetween(dateTime2Utc(IncHour(now, 0)), encodeDate(1970,1,1));
//DateTimeToUnix(IncHour(Now, 0));
TimeEnd := secondsBetween(dateTime2Utc(IncDay(now, 1)), encodeDate(1970,1,1));
//DateTimeToUnix(IncDay(Now, 1));
= 9:00 > 11:00 muss aber 10:00 > 12:00 sein.
Das scheint doch schwerer zu sein als gedacht.
Ich verwende auch kein UTC!
Siehe!
Delphi-Quellcode:
function DateTimeToUnix(const AValue: TDateTime; AInputIsUTC: Boolean): Int64;
var
LDate: TDateTime;
begin
if AInputIsUTC then
LDate := AValue
else
LDate := TTimeZone.Local.ToUniversalTime(AValue);
Result := SecondsBetween(UnixDateDelta, LDate);
if LDate < UnixDateDelta then
Result := -Result;
end;
Mein Aufruf in 10.4
DateTimeToUnix(IncHour(Now, 0),
false);