1.用CString Format( LPCTSTR pFormat ) const;将它格式成你想要的 具体见MSDN的 CTime::Format 及 strftime 2.CTime::GetTime 得到的时间为1970-01-01 0:0:0 到该时间的秒数 The time function returns the number of seconds elapsed since midnight (00:00:00), January 1, 1970, coordinated universal time, according to the system clock. The return value is stored in the location given by timer. This parameter may be NULL, in which case the return value is not stored. 3.CTime类中的方法的调用.可先定义一个CTime的变量,然后调用
CTime t = CTime::GetCurrentTime();
strCurTime.Format("%4d-%02d-%02d %02d:%02d:%02d",
t.GetYear(),t.GetMonth(),t.GetDay(),t.GetHour(),t.GetMinute(),t.GetSecond());
....
CString str = time.Format("%Y-%m-%d %H:%M:%S");
具体见MSDN的
CTime::Format
及
strftime
2.CTime::GetTime
得到的时间为1970-01-01 0:0:0 到该时间的秒数
The time function returns the number of seconds elapsed since midnight (00:00:00), January 1, 1970, coordinated universal time, according to the system clock. The return value is stored in the location given by timer. This parameter may be NULL, in which case the return value is not stored.
3.CTime类中的方法的调用.可先定义一个CTime的变量,然后调用