SYSTEMTIME st;
GetLocalTime(&st);
CTime tLocal(st);
CString strTime = tLocal.Format("%#c");
strTime += " Local";
TRACE("%s/n",strTime);//本地时间
strTime = tLocal.FormatGmt("%#c");
strTime += " UTC";
TRACE("%s/n",strTime);//格林威治时间
2023-11-25 19:48:10
SYSTEMTIME st;
GetLocalTime(&st);
CTime tLocal(st);
CString strTime = tLocal.Format("%#c");
strTime += " Local";
TRACE("%s/n",strTime);//本地时间
strTime = tLocal.FormatGmt("%#c");
strTime += " UTC";
TRACE("%s/n",strTime);//格林威治时间