可以用类COleDateTime .ParseDateTime 或者是用ColeVariant
例子如下所示
CString aa="1978-01-01 08:08:08"; COleVariant v(aa); v.ChangeType(VT_DATE); COleDateTime time1=v; CString str; COleDateTime Time; str = "2003-2-3"; Time.ParseDateTime(str);
可以用类COleDateTime .ParseDateTime 或者是用ColeVariant
例子如下所示
CString aa="1978-01-01 08:08:08"; COleVariant v(aa); v.ChangeType(VT_DATE); COleDateTime time1=v; CString str; COleDateTime Time; str = "2003-2-3"; Time.ParseDateTime(str);