CString strDataTime1 = "20161206_010405";
int tempYear,tempMonth,tempDay,tempHour,tempMin,tempSec;
CString strYear = strDataTime.Mid(0, 4);
CString strMonth = strDataTime.Mid(4, 2);
CString strDay = strDataTime.Mid(6, 2);
tempYear = atoi(strYear);
tempMonth = atoi(strMonth);
tempDay = atoi(strDay);
COleDateTime ole_time;
ole_time.SetDateTime(tempYear,tempMonth,tempDay,0,0,0);
CString strDateTime2 = ole_time.Format("%Y-%m-%d %H:%M:%S");
//时间差
COleDateTimeSpan timespan(1,0,0,0);
COleDateTime ole_MinTime = ole_time - timespan;
CString strDateTime3 = ole_MinTime.Format("%Y-%m-%d 00:00:00");