Autor Beitrag
Regan
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2157
Erhaltene Danke: 72


Java (Eclipse), Python (Sublimetext 3)
BeitragVerfasst: So 30.03.08 19:15 
Moin,

ich weiß, dass das ganze ganz einfach ist, aber ich bin zu dämlich dafür.
Ich habe folgenden Code:
ausblenden Delphi-Quelltext
1:
myNewDateTime:=Int(Now)+Frac(GetZeit(i));					

Dieser soll jetzt das Jetzt um die eingestellte Zeit bei GetZeit erhöhen. Alllerdings kommt da immer jetzt raus.
Was mache ich da falsch?

MfG
Regan
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: So 30.03.08 19:35 
ausblenden Delphi-Quelltext
1:
myNewDateTime := Now + Frac(GetZeit(i));					

alternativ wenn du nur die Zeit willst
ausblenden Delphi-Quelltext
1:
myNewDateTime := Frac(Now) + Frac(GetZeit(i));					


Der Nachkommaanteil ist der Zeitanteil, der vor dem Komma das Datum. Also fügt deine Methode dem Datum von Now die Zeit von GetZeit(i) hinzu.

mfG,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
Regan Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2157
Erhaltene Danke: 72


Java (Eclipse), Python (Sublimetext 3)
BeitragVerfasst: So 30.03.08 19:56 
Danke für die schnelle Anwort. Das löst mein Problem :zustimm: .