Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
function FormatFileTime(const mask: string; FileTime: TFileTime): string;
var
ModifiedTime: TFileTime;
SystemTime: TSystemTime;
begin
Result := '';
if (FileTime.dwLowDateTime = 0) and (FileTime.dwHighDateTime = 0) then
Exit;
try
FileTimeToLocalFileTime(FileTime, ModifiedTime);
FileTimeToSystemTime(ModifiedTime, SystemTime);
Result := FormatDateTime( mask, SystemTimeToDateTime(SystemTime) );
except
Result := FormatDateTime( mask, Now ); // Something to return in case of error
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
const
Mask = 'yyyy-mm-dd hh-nn-ss';
var
lpFindFileData: TWIN32FindData;
begin
FindFirstFile( pchar('c:\test.txt'), lpFindFileData );
Edit1.Text := FormatFileTime( mask, lpFindFileData.ftCreationTime );
Edit2.Text := FormatFileTime( mask, lpFindFileData.ftLastAccessTime );
Edit3.Text := FormatFileTime( mask, lpFindFileData.ftLastWriteTime );
end;