FileTime 和 CTime之间的转换问题
摘自:FileTime 和 CTime之间的转换问题
1. FileTime 转换成 CTime
方法(1)
FILETIME ft;
CTime time(ft);
方法(2)
FILETIME ft;
SYSTEMTIME st;
BOOL bSuccess=::FileTimeToSystemTime(&ft, &st)
if (bSuccess) //转换为SYSTEMTIME成功,下面转换成CTime
CTime time(st);
2. CTime 转换成 FileTime
CTime time(CTime::GetCurrentTime());
SYSTEMTIME st;
time.GetAsSystemTime(st);
FILETIME ft;
::SystemTimeToFileTime(&st, &ft);