procedure TForm1.Button2Click(Sender: TObject);
function FileTimeToDateTime(const ft:TFileTime):TDateTime;
var lt:TFileTime;
var st:TSystemTime;
begin
FileTimeToLocalFileTime(ft,lt);
FileTimeToSystemTime(lt,st);
Result:=SystemTimeToDateTime(st);
end;
function GetFileTime(fname:string ;var tCreation,tLastAccess, tLastWrite:TdateTime):boolean;
var F: TWin32FindData;
var h:THandle;
begin
h:=FindFirstFile(PChar(fname),F);
if h<>INVALID_HANDLE_VALUE then
begin
tCreation := FileTimeToDateTime( F. ftCreationTime );
tLastAccess := FileTimeToDateTime( F. ftLastAccessTime );
tLastWrite := FileTimeToDateTime( F. ftLastWriteTime );
Result:=True;
Windows.FindClose(h);
end;
Result:=false;
end;
var tCreation,tLastAccess, tLastWrite:TdateTime;
begin
with TOpenDialog.Create(Self) do try
if Execute then begin
GetFileTime(FileName,tCreation,tLastAccess, tLastWrite);  Caption:=DateTostr(tLastWrite);
end;
finally free; end;
end;