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;
   
}

原文地址:https://www.cnblogs.com/ahuo/p/1246165.html