VC获取当前系统时间

来源:互联网 发布:apps定位软件 编辑:程序博客网 时间:2024/06/05 16:59
CString str;
SYSTEMTIME st;
::GetLocalTime(&st);
CTime t;
t = CTime::CTime(st);
str = t.Format(L"%Y-%m-%d");


CString str0 = t.Format(L"%H:%M:%S");
MessageBox(str,L"提示",0);
MessageBox(str0,L"提示",0);