日期转换问题!
CTime tmpTime = CTime::GetCurrentTime();
//假设得到Tuesday, 08/20/02
我想要把它转换成“星期二,2002年8月20日”
并把它存入buf数组中,
谢谢!
问题点数:100、回复次数:4Top
1 楼ynyn(风林火山)回复于 2002-08-20 16:46:01 得分 50
tmpTime.Format()Top
2 楼striking(庸人自扰)回复于 2002-08-20 17:06:57 得分 0
Format()好像不能转换为中文Top
3 楼baixc(小糊涂)回复于 2002-08-20 17:17:08 得分 50
用字符串自己判断,反正不多。
用结构体得到 星期,日,月,年,然后转化。
Top
4 楼striking(庸人自扰)回复于 2002-08-20 17:46:01 得分 0
我是这样做的,帮忙看一下,谢谢!
char timebuf[100];
CTime tmpTime1 = CTime::GetCurrentTime();
tmpTime1.GetTime();
strcat( timebuf ,(LPSTR)(LPCTSTR)tmpTime1.Format("%H:%M:%S") );
strcat( timebuf , " ");
tmpTime1.GetYear();
strcat( timebuf ,(LPSTR)(LPCTSTR)tmpTime1.Format("%Y") );
strcat( timebuf , "年");
tmpTime1.GetMonth();
strcat( timebuf ,(LPSTR)(LPCTSTR)tmpTime1.Format("%B") );
strcat( timebuf , "月");
tmpTime1.GetDay();
strcat( timebuf , (LPSTR)(LPCTSTR)*/tmpTime1.Format("%d") );
strcat( timebuf , "日 ");
Top




