Autor Beitrag
Sephiroth
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 102



BeitragVerfasst: Do 21.11.02 14:53 
Wie berechne ich den Minutenunterschied zwischen zwei TDateTime-Variablen?

Beispiel:
2002-11-22 16:12:45
2002-11-21 14:11:05

Ich kann natürlich die einzelnen Werte (Jahr,Monat,Stunde etc.) einfach minus miteinander rechnen und dann für jede Stunde die übrig bleibt * 60 rechnen etc.
Gibt es da aber eine einfachere Lösung?
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Do 21.11.02 15:18 
Hallo

hast du dir schon mal die Onlinehilfe zu TDatetime durchgelesen?

Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
Sephiroth Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 102



BeitragVerfasst: Do 21.11.02 15:25 
Meinst du die Delphi-Hilfe? Wenn du diese meinst dann: Ja hab ich
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Do 21.11.02 15:38 
in Tdatetime ist ja auch die Tageszeit drin, alos nur die differenz bilden und *24*60 Minuten pro tag
habs grad mal probiert:

ausblenden Quelltext
1:
2:
3:
  t1:=STRtodatetime(edit1.text);
  t2:=STRtodatetime(edit2.text);
  label1.caption:=floattostr(trunc((t1-t2)*24*60));


kommt 1561 raus, sollte stimmen ?

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)