api时间转换VarDateFromStr,VariantTimeToSystemTime

#include <ATLCONV.H>
void OnButton3()
{

 USES_CONVERSION;
 DATE m_dt;
 _bstr_t bstrDate=__DATE__;
  VarDateFromStr(bstrDate,  LANG_USER_DEFAULT, 0, &m_dt);
  _variant_t vTime;
  vTime=m_dt;
 SYSTEMTIME stTmp;
  VariantTimeToSystemTime(vTime, &stTmp);
  int y=stTmp.wYear;
   
}

posted @ 2008-07-18 15:53  ahuo  阅读(1805)  评论(0编辑  收藏  举报