CString strDate = "2011-05-05 12:23:22" // 这种合法的格式
COleVariant vtime(strDate);//从字符串中格式化出日期
vtime.ChangeType(VT_DATE);COleDateTime time4=vtime;
SYSTEMTIME systime;
VariantTimeToSystemTime(time4, &systime);
COleDateTime ctm(systime);
strDate = ctm.Format("%Y-%m-%d");