1.使用CTime类(获取系统当前时间,精确到秒)
CString str;
//获取系统时间
CTime tm;
tm=CTime::GetCurrentTime();//获取系统日期
str=tm.Format(现在时间是%Y年%m月%d日 %X);
MessageBox(str,NULL,MB_OK);
a,从CTimet中提取年月日时分秒
CTime t = CTime::GetCurrentTime();
int d=t.GetDay(); //获得几号
int y=t.GetYear(); //获取年份
int m=t.GetMonth(); //获取当前月份
i