Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Datumsvergleich (https://www.delphipraxis.net/9541-datumsvergleich.html)

TheMiller 28. Sep 2003 21:19


Datumsvergleich
 
Hey Leute

wenn ich eine Datei auf Diskette ziehe, wird sie doch mit dem aktuellem Datum versehen. Wie kann ich das Datum auslesen lassen und im Programm prüfen, ob sie am 22.10 oder am 23.12 ausgespeilt wurde?

Hat jmd. eine Idee hatte dies schon mal verwendet
Delphi-Quellcode:
var FI: TWin32FileAttributeData;
var ST: TSystemTime;
begin

  if GetFileAttributesEx('A:\', GetFileExInfoStandard, @FI) then
  begin
    FileTimeToSystemTime(FI.ftCreationTime, ST);
    ShowMessage( 
      IntToStr(ST.wYear) + '\' +
      IntToStr(ST.wMonth) + '\' + 
      IntToStr(ST.wDay) + ' ' +
      IntToStr(ST.wHour) + ':' + 
      IntToStr(ST.wMinute) + ':' +
      IntToStr(ST.wSecond)
    );
aber es kommt immer folgendes raus
Delphi-Quellcode:
1979/10/10 22:0:0
ich verstehe das nciht *g*

Christian Seehase 29. Sep 2003 00:45

Re: Datumsvergleich
 
Moin DJ-SPM,

ich hab' das mal gerade ausprobiert.
Nehme ich Deinen Originalcode erhalte ich

1979/12/32 22:0:0

Gebe ich hingegen einen Dateinamen an, erhalte ich das korrekte Datum.

Delphi-Quellcode:
if GetFileAttributesEx('A:\TESTDATEI.TXT', GetFileExInfoStandard, @FI) then


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:22 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz