//当前本地时间,精确到秒
CTime time = CTime::GetCurrentTime();
CString strMsg = time.Format(_T("%Y-%m-%d %H:%M:%S"));
//UTC时间,精确到毫秒,转化为北京时间加8
SYSTEMTIME systime;
GetSystemTime(&systime);
CString strMsg;
strMsg.Format(_T("%u-%02u-%02u %02u:%02u:%02u %03u"),systime.wYear,
systime.wMonth,
systime.wDay,
systime.wHour+8,
systime.wMinute,
systime.wSecond,
systime.wMilliseconds);
CTime time = CTime::GetCurrentTime();
CString strMsg = time.Format(_T("%Y-%m-%d %H:%M:%S"));
//UTC时间,精确到毫秒,转化为北京时间加8
SYSTEMTIME systime;
GetSystemTime(&systime);
CString strMsg;
strMsg.Format(_T("%u-%02u-%02u %02u:%02u:%02u %03u"),systime.wYear,
systime.wMonth,
systime.wDay,
systime.wHour+8,
systime.wMinute,
systime.wSecond,
systime.wMilliseconds);