Autor Beitrag
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Mo 14.10.02 15:11 
Hi,
gibt es eine Möglichkeit, mit TDateTime zurechnen?
Z.B.vom 29.03.1988 05:45:00 bis zum 30.03.1988 05.00.00 sind es 0 Tage, 0 Monate, 0 Jahre, 23 Stunden, 15 Minuten und 0 Sekunden.

maxk

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 14.10.02 15:19 
geht, wie mit normalen Zahlen auch.

Ob allerdings eien Multiplikation oder Division großartig Sinn macht... :roll:
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: Mo 14.10.02 15:44 
Hallo,

TDateTime ist eine ganz normale Fließkomma Zahl. Der Wert vor dem Komma sind die Tage seit dem 30.12.1899 12.00 Uhr. Und nach dem Kommer folgen halt gebrochende Tage. Also 0,5 sind 12 Stunden.
Hier mal ein Paar Beispielwerte:
Delphi-Hilfe hat folgendes geschrieben:
0 30.12.1899 12.00 Uhr
2.75 1.1.1900 18.00 Uhr
-1.25 29.12.1899 6.00 Uhr
35065 1.1.1996 12:00 am


Eine Differend rechnest du also so aus:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
VAR
  Dif : tDateTime;
BEGIN
  Dif := Datum2 - Datum1;
  ShowMessage('Differenz: ' + IntToStr(Trunc(Dif)) + ' Tage und ' + FormatDateTime('hh:nn:ss', Dif));
[...]


Gruß
Klabautermann
maxk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Di 15.10.02 10:09 
:D :D :D Danke, es funzt...

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.