https://www.cnblogs.com/bigbigtree/archive/2011/12/02/2272066.html
①操作:成功
CString str; CTime tm; tm=CTime::GetCurrentTime(); str=tm.Format("现在时间是%Y年%m月%d日 %X"); MessageBox(str,NULL,MB_OK);②操作:成功
SYSTEMTIME st; CString strDate,strTime; GetLocalTime(&st); strDate.Format(L"M----",st.wYear,st.wMonth,st.wDay); strTime.Format(L"-:-:-",st.wHour,st.wMinute,st.wSecond);③操作:
CString str,str1; long t1=GetTickCount(); Sleep(500); long t2=GetTickCount(); str.Format(L"time:%dms",t2-t1); AfxMessageBox(str); long t=GetTickCount(); str1.Format(L"系统已运行 %d时",t/3600000); str=str1; t%=3600000; str1.Format(L"%d分",t/60000); str+=str1; t%=60000; str1.Format(L"%d秒",t/1000); str+=str1; AfxMessageBox(str);