有没有很方便的api函数?

解决方案 »

  1.   

    or MFC functions:COleDateTime t = COleDateTime::GetCurrentTime();
      

  2.   

    sorry, what was I thinking, :-)MFC functions
    ===>
    MFC class
      

  3.   

    CTime time_now=CTime::GetCurrentTime();
    time_now.GetDay()       //当前日期
    time_now.GetHour()      //当前时间 时
    time_now.GetMinute()    //当前时间 分类推 年 月 日 时 分 秒
      

  4.   

    COleDateTime TD;
    CString strTD;TD=TD.GetCurrentTime();
    strsql.Format("%d",nLevel);
    strTD.Format("%d-%d-%d %d:%d:%d",TD.GetYear(),TD.GetMonth(),TD.GetDay(),TD.GetHour(),TD.GetMinute(),TD.GetSecond());strTD就是格式化后的系统日期!!