vc++中如何获得系统时间

代码如下,主要利用了GetSystemTime这个API函数

SYSTEMTIME tm;
GetSystemTime(&tm);
CString str;
str.Format("%d年%d月%d日",tm.wYear,tm.wMonth,tm.wDay);
MessageBox(str);

Leave a Reply

Your email address will not be published. Required fields are marked *