extern "C" _declspec ( dllexport ) int PASCAL getfiledatetime(char * filename, char *filedate, char *filetime) { HANDLE hFile; FILETIME ftCreate, ftLastAccess, ftLastWrite; SYSTEMTIME st,stUTC; char buf[80]; // Open the file. hFile = CreateFile( filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); if (hFile==INVALID_HANDLE_VALUE) { return 0; } // Get the file time (in UTC) and convert to local time. GetFileTime( hFile, &ftCreate, &ftLastAccess, &ftLastWrite ); FileTimeToSystemTime( &ftLastWrite, &stUTC ); SystemTimeToTzSpecificLocalTime( NULL, &stUTC, &st); // Display the time, as a test. 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; }