COleDateTime oleDate = COleDateTime::GetCurrentTime();
_variant_t vtFld;
vtFld.vt = VT_DATE;
vtFld.date = oleDate;
pRecordSet4->PutCollect("date", vtFld);
读时间值
_bstr_t TheValue=m_pset->Fields->GetItem("出生年月")->Value;
temp=(char *)TheValue;
COleVariant vtime(temp);
vtime.ChangeType(VT_DATE);
COleDateTime time4=vtime;//读出的是COleDateTime
用下面的方法转换
COleDateTime time1(1977,4,16,2,2,2); //COleDataTime--->CTime
SYSTEMTIME systime;
VariantTimeToSystemTime(time1, &systime);
CTime tm(systime);
本文地址:http://com.8s8s.com/it/it543.htm