CTime time = CTime::GetCurrentTime();
CString strTime = time.Format("%H:%M:%S");
输出时间17:02:00
由于我需要在系统时间上加上一个偏移,采用一下方法
h=(int)t.wHour;
min=(int)t.wMinute;
s=(int)t.wSecond;
CString strTime;
strTime.Format("%d :%d:%d:",h,min,s);
输出时间格式为17:2:0
有没有比较好的方法改善!(除用if判断)