Autor Beitrag
JustusJonas
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 222



BeitragVerfasst: Mo 15.12.03 14:35 
Hi,

ich möchte ein paar Dateien nach dem Datum sortieren.
So weit auch alles klar mit FindFirst und TSearchRecord.
Mein Problem ist lediglich, wie ich TSearchRecord.Time in eine vernünftige Formatierung bringen kann!?

Würde mich freuen, wenn mir jemand helfen kann!

Greetz
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Mo 15.12.03 15:46 
Hallo,

in der Hilfe von Delphi zu TSearchRec steht, dass die Werte von SearchRec.Time mit der Funktion FileDateToDateTime in einen Wert vom Typ TDateTime konvertiert werden kann.

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
JustusJonas Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 222



BeitragVerfasst: Mo 15.12.03 16:04 
Ja das weiß ich schon!
Wenn ich das Format nicht umwandeln bekomme ich folgendes:
793271417
Mit FileDateToDateTime(sr.Time) bekomme ich dann folgende Ausgabe:
37902,4832175926

Damit kann ich auch nicht sonderlich anfangen.
Ich war schon in der Lage in die Delphi-Hilfe zu schauen, leider hat diese mir auch nicht weitergeholfen! :(

Greetz
MAlsleben
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 303

W2k,WinXP
D3 - DXE3 Enterprise
BeitragVerfasst: Di 16.12.03 12:57 
Hi,

mir würde jetzt nur noch DateTimeToStr(DateTime: TDateTime) nach der ersten Umwandlung einfallen.

Gruß Micha.

_________________
Viele Wege führen nach Rom.
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Di 16.12.03 13:05 
Hallo,

MAlsleben hat es ja schon geschrieben: Du musst den TDateTime-Wert, den Dir die Funktion FileDateToDateTime liefert, nur noch in einen String umwandeln.

ausblenden Delphi-Quelltext
1:
  Label1.Caption:=DateTimeToStr(FileDateToDateTime(sr.Time));					

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
JustusJonas Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 222



BeitragVerfasst: Di 16.12.03 13:14 
Hey klasse, vielen Dank!

Das war ja einfacher als ich dachte!

Danke!

Greetz