if((hFile=FindFirstFile("D:\\aa.txt", &wfd))==INVALID_HANDLE_VALUE) { return ;//失败 } //ok,转换时间 FileTimeToLocalFileTime(&wfd.ftLastWriteTime,&localtime); FileTimeToSystemTime(&localtime,&systime); typedef struct _SYSTEMTIME { WORD wYear; WORD wMonth; WORD wDayOfWeek; WORD wDay; WORD wHour; WORD wMinute; WORD wSecond; WORD wMilliseconds; //这里就有你要的ms级时间. } SYSTEMTIME;
{HANDLE hFile;
WIN32_FIND_DATA wfd;
SYSTEMTIME systime;
FILETIME localtime;
memset(&wfd, 0, sizeof(wfd));
if((hFile=FindFirstFile("D:\\aa.txt", &wfd))==INVALID_HANDLE_VALUE)
{ return ;//失败
}
//ok,转换时间
FileTimeToLocalFileTime(&wfd.ftLastWriteTime,&localtime);
FileTimeToSystemTime(&localtime,&systime); typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds; //这里就有你要的ms级时间.
} SYSTEMTIME;