CString和CTime互相轉換

//CString轉CTime==============

CString strT1="2020-02-02 02:02:02";

int ny,nm.nd;

sscanf(strT1.GetBuffer(strT1.GetLength()),"%d-%d-%d",&ny,&nm,&nd);

CTime T1(a,b,c,0,0,0);

//CTime轉CString

CTime T1=CTime::GetCurrentTime();

CString strT1;

strT1.Format("%d-%d-%d",T1.GetYear,T1.GetMonth(),T1.GetDay());

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章