CString strDate = "2008-12-8";
CString strTime = "12:50:40";怎么将这2个字符串转换成COleDateTime 类型?
这2个字符串值是不定的...

解决方案 »

  1.   


    CString strDate = "2008-12-8"; 
    CString strTime = "12:50:40"; COleDateTime t = COleDateTime::ParseDateTime( strDate + CString(" ") + strTime );
      

  2.   

    上边代码有错误,改正: CString strDate = "2008-12-8"; 
    CString strTime = "12:50:40"; 

    COleDateTime t;

    t.ParseDateTime( strDate + CString(" ") + strTime );
      

  3.   

    if (InvoiceDate.ParseDateTime("2010-12-23"))
    {
    CString strDate = InvoiceDate.Format("%Y%m%d");
    }