久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

CString,、CTime和COleDateTime轉(zhuǎn)換

 水中麒麟 2014-05-15
(2011-10-24 10:11:42)作者:中天數(shù)字

COleDateTime,、CTime--->CString
這個方法很簡單,用Format格式化一個字符串就可以了,,詳見MSDN


CString--->COleDateTime:

方法1:COleDateTime::ParseDateTime()

[轉(zhuǎn)載]CString、CTime和COleDateTime轉(zhuǎn)換CString strDate = _T("1987-06-21");
[轉(zhuǎn)載]CString、CTime和COleDateTime轉(zhuǎn)換COleDateTime oleDate;
[轉(zhuǎn)載]CString,、CTime和COleDateTime轉(zhuǎn)換oleDate.ParseDateTime(strDate, VAR_DATEVALUEONLY);

方法2:COleVariant

[轉(zhuǎn)載]CString,、CTime和COleDateTime轉(zhuǎn)換CString strDate = _T("1987-06-21");
[轉(zhuǎn)載]CString、CTime和COleDateTime轉(zhuǎn)換COleVariant varTime(strDate);
[轉(zhuǎn)載]CString,、CTime和COleDateTime轉(zhuǎn)換varTime.ChangeType(VT_DATE);
[轉(zhuǎn)載]CString,、CTime和COleDateTime轉(zhuǎn)換COleDateTime oleDate(varTime);
[轉(zhuǎn)載]CString、CTime和COleDateTime轉(zhuǎn)換
//COleDateTime oleDate;
[轉(zhuǎn)載]CString,、CTime和COleDateTime轉(zhuǎn)換
//oleDate=varTime;

COleDateTime--->CTime:

方法1:用COleDateTime::GetAsSystemTime(SYSTEMTIME& sysTime)

[轉(zhuǎn)載]CString,、CTime和COleDateTime轉(zhuǎn)換COleDateTime oleDate(1987621000);
[轉(zhuǎn)載]CString、CTime和COleDateTime轉(zhuǎn)換SYSTEMTIME sysTime;
[轉(zhuǎn)載]CString,、CTime和COleDateTime轉(zhuǎn)換oleDate.GetAsSystemTime(sysTime);
[轉(zhuǎn)載]CString,、CTime和COleDateTime轉(zhuǎn)換CTime tm(sysTime);

方法2:用VariantTimeToSystemTime函數(shù)
COleDateTime--->SYSTEMTIME--->CTime

[轉(zhuǎn)載]CString、CTime和COleDateTime轉(zhuǎn)換COleDateTime oleDate(1987621000);
[轉(zhuǎn)載]CString,、CTime和COleDateTime轉(zhuǎn)換SYSTEMTIME sysTime;
[轉(zhuǎn)載]CString、CTime和COleDateTime轉(zhuǎn)換VariantTimeToSystemTime(oleDate, 
&sysTime);
[轉(zhuǎn)載]CString,、CTime和COleDateTime轉(zhuǎn)換CTime tm(sysTime);


CTime--->COleDateTime:

方法1:用CTime::GetTime()得到time_t

[轉(zhuǎn)載]CString,、CTime和COleDateTime轉(zhuǎn)換CTime time(1987621000);
[轉(zhuǎn)載]CString、CTime和COleDateTime轉(zhuǎn)換time_t tm 
= time.GetTime();
[轉(zhuǎn)載]CString,、CTime和COleDateTime轉(zhuǎn)換COleDateTime oleTime(tm);

方法2:用COleDateTime::GetAsSystemTime(SYSTEMTIME& sysTime)

[轉(zhuǎn)載]CString,、CTime和COleDateTime轉(zhuǎn)換CTime time(1987621000);
[轉(zhuǎn)載]CString、CTime和COleDateTime轉(zhuǎn)換SYSTEMTIME   sysTime;
[轉(zhuǎn)載]CString,、CTime和COleDateTime轉(zhuǎn)換time.GetAsSystemTime(sysTime);
[轉(zhuǎn)載]CString,、CTime和COleDateTime轉(zhuǎn)換COleDateTime oleTime(sysTime);
[轉(zhuǎn)載]CString、CTime和COleDateTime轉(zhuǎn)換
//COleDateTime oleTime;
[轉(zhuǎn)載]CString,、CTime和COleDateTime轉(zhuǎn)換
//oleTime=sysTime;

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,,不代表本站觀點,。請注意甄別內(nèi)容中的聯(lián)系方式、誘導購買等信息,,謹防詐騙,。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報,。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多