Autor Beitrag
deagle
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 89



BeitragVerfasst: Mo 21.10.02 23:10 
Hallo,

Wenn ich delphi sage das der das Datum auslesen soll klappt das auch nur der Zeit mir 31.12.99 an!!

Ich verwende diesen Code

ausblenden Quelltext
1:
  label1.Caption := FormatDateTime('dd:mm:yy', Time);					


Und arbeite mit Delphi 6
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Di 22.10.02 07:46 
Hi
eine Zeitinformation besteht bei mir aus Stunde, Minute usw. und bei Delphi ist das auch nicht anders. Was sollte denn dein Code als Ausgabe liefern, wenn du versuchst eine Zeit als Datum darzustellen :roll:

Richtig wäre:
ausblenden Quelltext
1:
label1.Caption := FormatDateTime('hh:nn:ss', Time);					

Zur Erklärung: ein TDateTime ist nix anderes als eine Gleitkommazahl. Der ganzahlige Anteil ist das Datum in Tagen seit 31.12.1899, die Nachkommastellen ist die Uhrzeit.
Time liefert nur den Nachkommateil, und wenn du dann versuchst das als Datum anzuzeigen kommt eben raus 0 Tage seit 31.12.1899. Genau das bekommst du auch angezeigt.

Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
Matthias
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 121



BeitragVerfasst: Di 22.10.02 07:48 
:idea: Hy,

beim Durchlesen ist mir aufgefallen, dass Du Time anstatt Date oder Now verwendest. Du möchtest jedoch das Datum ausgeben.

ciao

Matthias
deagle Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 89



BeitragVerfasst: Di 22.10.02 11:14 
Hi,

Ja, wie bekomm ich das den jetzt hin?

D-Eagle
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Di 22.10.02 11:25 
Hi
Liest du immer nur die letzte Anwort? Gut, nochmal in Gross und Bunt

label1.Caption := FormatDateTime('hh:nn:ss', Time);

oder

label1.Caption := FormatDateTime('dd/mm/yy', Date);

oder

label1.Caption := FormatDateTime('dd/mm/yy hh:nn:ss', Now);



Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
deagle Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 89



BeitragVerfasst: Mi 23.10.02 00:18 
Nein,

Danke @ LCS

Nochmal in klein

Danke @ LCS
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Mi 23.10.02 09:14 
Gern geschehen :mrgreen:

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...