Get File Modified Date and Time DLL
By IsmAvatar
Made in Pascal

DLL: getfilemod.dll (the name may be changed freely)
Function: _lastmod
Type: stdcall
Returns: pchar (string)
Arguments: 1
Argument0: pchar (string)
Errors: If the file age cannot be found (eg: file cannot be found),
 an empty string is returned. This dll should not crash.

Usage:
Argument0 is the filename that you want to get the "Last Modified Date" of
This returns the date in a string format yyyy-MM-dd HH:mm
Where HH is 24-hour format.
Example: the file "C:\myfile.txt" was last modified
October 12, 2005 at 8:45 pm. If I call the function with argument
"C:\myfile.txt" it will return "2005-10-12 20:45", however, if I
call it with argument "C:\myfile.yxt" and given file doesn't exist,
it will return an empty string "".

credit: Not necessary, but appreciated.

source (pascal):

library FileGetModified;
uses sysutils;
function _lastmod(f : pchar) : pchar; stdcall;
var
 s : string;
 a : longint;
begin
 a := fileage(f);
 if a = -1 then
 begin
  _lastmod := '';
  halt;
 end;
 s := datetimetostr(filedatetodatetime(a));
 _lastmod := @s;
end;
exports _lastmod;
begin end.