Autor Beitrag
Frankle
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: Do 25.07.02 16:20 
Hallo!
Ich suche eine Funktion...an dich ich 2 Daten übergebe (das 2. ist das aktuelle) und die Funktion soll dann ausspucken...wie lange noch Zeit ist! Sprich: 1T 2Std 3M

Dankööööö

_________________
---------------------------
God Safe QUEEN
"The Show Must Go On"
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Do 25.07.02 17:14 
Hallo,

da tDateTime ein Flißkommawert ist kannst du einfach damit rechen.

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure SayDiv(Datum1, Datum2 : tDateTime);
  VAR
     DivTime : tDateTime;
BEGIN
  DivTime := Datum2 - Datum1;
  ShowMessage('Noch ' + Trunc(DivTime) + ' Tage und ' + FormatDateTime('hh:nn:ss', DivTime));
END;


Die Zahl vor dem Komma ist die anzahl der Tage und die Zahlen dahinter entsprechend der Buch eines Tagen (z.B. 0.5 = 12 Stunden).

Gruß
Klabautermann