怎么将字符串转换成时间格式,并将该时间+150秒,再将新时间转换成字符串

如何将字符串转换成时间格式,并将该时间+150秒,再将新时间转换成字符串?
各位大虾:

  如何将字符串转换成时间格式,字符串格式为“20120702123456”,表示2012年7月2日12点34分56秒;
并将该时间加上150秒得到新时间,再将新时间转换成字符串保存。请问在VC++中如何处理???

------解决方案--------------------
http://blog.****.net/jennyvenus/article/details/7428061

字符串转数字,转完之后,你再把时间算成秒数,然后再150,再算成时间就行了。

------解决方案--------------------
CString str=L"20120702123456";
CString strYear,strMonth,strDay,strHour,strMinutes,strSecond;
strYear=str.Mid(0,4);//2012
strMonth=str.Mid(4,2);//07
strDay=str.Mid(6,2);//02
strHour=str.Mid(8,2);//12
strMinutes=str.Mid(10,2);//34
strSecond=str.Mid(12,2);//56

int tempYear,tempMonth,tempDay,tempHour,tempMin,tempSec,tempAll;
tempYear=_wtoi(strYear);//2012
tempMonth=_wtoi(strMonth);//7
tempDay=_wtoi(strDay);//2
tempHour=_wtoi(strHour);//12
tempMin=_wtoi(strMinutes);//34
tempSec=_wtoi(strSecond);//56

int Minu=150/60;
int Seco=150%60;

tempMin+=Minu;
tempSec+=Seco;
 
if (tempSec>=60)
{
tempMin+=1;
tempSec-=60;
if (tempMin>=60)
{
tempHour+=1;
tempMin-=60;
}
}

COleDateTime m_tStartDateTime;
m_tStartDateTime.SetDateTime(tempYear,tempMonth,tempDay,tempHour,tempMin,tempSec);
CString strDate=m_tStartDateTime.Format(L"%Y%m%d%H%M%S");
------解决方案--------------------
用CTime对象,省时省力。