SYSTEMTIME SystemTime; 需要头文件windows.h
GetSystemTime(&SystemTime);
这样获取的星期显示的阿拉伯数字,要想出现中文的,需要加一个switch判断。具体办法如下:
CString cstrm_strWeek;
switch (SystemTime.wDayOfWeek){
case 0:
cstrm_strWeek.Format(L"星期日");
break;
case 1:
cstrm_strWeek.Format(L"星期一");
break;
case 2:
cstrm_strWeek.Format(L"星期二");
break;
case 3:
cstrm_strWeek.Format(L"星期三");
break;
case 4:
cstrm_strWeek.Format(L"星期四");
break;
case 5:
cstrm_strWeek.Format(L"星期五");
break;
case 6:
cstrm_strWeek.Format(L"星期六");
break;
}