CString strTime;
unsigned int dwtime = time(NULL);
struct tm* pCurTime;
pCurTime = localtime((const time_t*)(&dwtime));
strTime.Format("%04d-%02d-%02d %02d:%02d:%02d", pCurTime->tm_year + 1900,
pCurTime->tm_mon + 1,
pCurTime->tm_mday,
pCurTime->tm_hour,
pCurTime->tm_min,
pCurTime->tm_sec);
CTime cCurTime = CTime::GetCurrentTime();
CString strCurTime = cCurTime.Format("%Y%m%d%H%M%S");
AfxMessageBox(strCurTime);