char datebuf[18];
CString str1;
time_t ltime;
struct tm *today; today = localtime(<ime); strftime(datebuf,18,"day:%dmon:%Byear:%Y",today);//执行到这里出错
str1=(CString)datebuf;
AfxMessageBox(str1);
CString str1;
time_t ltime;
struct tm *today; today = localtime(<ime); strftime(datebuf,18,"day:%dmon:%Byear:%Y",today);//执行到这里出错
str1=(CString)datebuf;
AfxMessageBox(str1);
在today = localtime(<ime);前
加
time(<ime);
CString str1;
time_t ltime;
struct tm *today; time(<ime);
today = localtime(<ime); strftime(datebuf,18,"day:%dmon:%myear:%Y",today);//执行到这里出错
str1.Format("%s", datebuf);
AfxMessageBox(str1);
today = localtime(<ime);