1
我正在以ColeDateTime
格式從數據庫讀取日期時間。我想將其轉換爲CTime
以獲取日期月份和時間。要將ColeDateTime轉換爲CTime
CString repDt; //**this will hold the datetime which i read from Database**
COleDateTime dt;
//**my datetime format is mm/dd/yyyy.**
dt.ParseDateTime(repDt); **//this line of code gives exception**
CTime t(dt.GetYear(), dt.GetMonth(), dt.GetDay(), dt.GetHour(),
dt.GetMinute(), dt.GetSecond());
m_time=t.GetTime();
請給我一些解決方案我怎麼能做到這一點?
在此先感謝。
首先嚐試轉換repDT至今。 –