获得系统时间
1、使用CTime精确到秒
CTime time = CTime::GetCurrentTime();
CString time_str;
time_str.Format(_T("%d-%d-%d-%d"),time.GetMonth(),time.GetDay(),time.GetHour(),time.GetMinute());//
2、使用GetLocalTime精确到毫秒
SYSTEMTIME lpSystemTime;//精确到毫秒
GetLocalTime(&lpSystemTime);
CString time_str;
time_str.Format(_T("%02d-%02d-%03d:"),lpSystemTime.wMinute,lpSystemTime.wSecond,lpSystemTime.wMilliseconds);
长风破浪会有时,直挂云帆济沧海!
可通过下方链接找到博主
https://www.cnblogs.com/judes/p/10875138.html