![]() |
Order and save right now!
20% off with the 729824315 dicscount code for Ultimate Pack and any another product for Delphi from Greatis Programming! |
⤷ Get date/time of creation of file
Use FileAge function, which returns date and time stamp of file. Use this result in FileDateToDateTime function for converting to TDateTime type.
procedure TForm1.Button1Click(Sender: TObject);
var
FAge: Integer;
FileParam: TDateTime;
begin
if OpenDialog1.Execute then
Edit1.Text:=OpenDialog1.FileName;
FAge:=FileAge(Edit1.Text);
FileParam:=FileDateToDateTime(FAge);
Label2.Caption:='Date of creation - '+DateToStr(FileParam);
Label3.Caption:='Time of creation - '+TimeToStr(Fileparam);
end;
- Related components
- TFileSearch
- TFolderMonitor
- TFileVersion
-
More for developers