Hallo,
ich habe mal folgende Funktion gefunden.
Delphi-Quellcode:
function DateTimeDiff(date1, date2: TDateTime): string;
var days, hours, minutes, secs: integer;
difference: real;
begin
difference:=date2-date1;
days:=round(difference-Frac(difference));
difference:=Frac(difference)*24;
hours:=round(difference-Frac(difference));
difference:=Frac(difference)*60;
minutes:=round(difference-Frac(difference));
difference:=Frac(difference)*60;
secs:=round(difference-Frac(difference));
result:=IntToStr(days)+' Tage, '+IntToStr(hours)+' Stunden, '+IntToStr(minutes)+
' Minuten, '+IntToStr(secs)+' Sekunden';
end;
Die ist nicht von mir. Wahrscheinlich funktioniert sie deshalb so gut.
bis dann
Ravus