Autor Beitrag
Fighter#1
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: So 12.02.06 14:44 
Hallo, ich möchte zwei Uhrzeiten voneinander abziehen, das ich dann die differenz bekomme.
Das funktioniert auch alles super.
ICh möchente nun die Differenz in Sekunden angezeigt hab, ich möchte dann mit der Zahl weiterrechnen.
Könnt ihr mir bitte sagen wie das geht?
Also das soll dann so aussehen
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var Zeit1,Zeit2,Diff:TTime;
    Zahl:Integer;
begin
Zeit1:=StrToTime('14:55:00');
Zeit2:=StrToTime('15:00:00');
Diff:=Zeit2-Zeit1;
//Diff ist dann als String 'OO:05:00' 
Zahl:=TimeToInt(Diff)*89;
end;

_________________
Wer andere beherrscht ist stark,
wer sich selbst beherrscht ist mächtig. Lao Tse
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 12.02.06 14:55 
Zeit (TDateTime) ist Double, wobei ein Tag exakt 1.0 entspricht. Eine Sekunde ist dementsprechend 1.0 / 24 / 60 / 60

AXMD
Fighter#1 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: So 12.02.06 14:58 
Das beantwortet meine Frage, soweit ich dich versteh, nicht hinreichend.
Ich wollte wissen ob es eine Funktion gibt, oder ihr eine parad habt, die mir aus '00:05:00' den Integer Wert : 300 gibt ( 5 * 60 . . .)

_________________
Wer andere beherrscht ist stark,
wer sich selbst beherrscht ist mächtig. Lao Tse
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 12.02.06 15:04 
Nein, aber du kannst DecodeTime verwenden und dann das Ergebnis entsprechend multiplizieren.

AXMD
Fighter#1 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: So 12.02.06 15:21 
Titel: DANKE !
Super das macht das Problem schon viel kleiner!
Habs jetzt so gelöst:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
function zeitgesamt(anfang,ende:TTime):Integer;
var dazwischen:TTime;
Stunde,Minute,Sekunde,Millisekunde:Word;
begin
dazwischen:=ende-anfang;
DecodeTime(dazwischen,stunde,Minute,Sekunde,Millisekunde);
result:=(stunde*3600) + (minute*60) + Sekunde;
end;

_________________
Wer andere beherrscht ist stark,
wer sich selbst beherrscht ist mächtig. Lao Tse