extern "C" _declspec ( dllexport ) int PASCAL getfiledatetime(char * filename, char * filedate, char *filetime) { HANDLE hFile; FILETIME ftCreate, ftLastAccess, ftLastWrite, ftLocal; SYSTEMTIME st; char buf[80]; // Open the file. hFile = CreateFile( filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); // Get the file time (in UTC) and convert to local time. GetFileTime( hFile, &ftCreate, &ftLastAccess, &ftLastWrite ); FileTimeToLocalFileTime( &ftLastWrite, &ftLocal ); // Display the time, as a test. FileTimeToSystemTime( &ftLocal, &st ); GetTimeFormat( LOCALE_USER_DEFAULT, 0, &st, NULL, buf, sizeof(buf) ); strcpy(filetime,buf); GetDateFormat( LOCALE_USER_DEFAULT, 0, &st, NULL, buf, sizeof(buf) ); strcpy(filedate,buf); CloseHandle(hFile); return 1; }