1 2 //this code demostrates how to set the modify date and time of any given file3 4 procedure SetFileDate (TheFileName: string; aDate: string);
5 var6 f : integer;
7 begin8 //opens file9 f := FileOpen (TheFileName, fmOpenReadWrite);
10 try11 //sets date to file12 FileSetDate (f, DateTimeToFileDate ((StrToDateTime (aDate))));
13 finally14 FileClose (f)
15 end16 end;
17 18 procedure TForm1.Button1Click(Sender: TObject);
19 begin20 SetFileDate('c:\test.txt','12/12/2002 11:00 am');
21 end;