菜鸟求救

解决方案 »

  1.   

    CTime MyTime;
    CString MyTimeString;
    MyTimeString = MyTime.Format("%Y年%m月%d日");
      

  2.   

    同意楼上CTime MyTime = CTime::GetCurrentTime();可得到当前时间
      

  3.   

    tmbuf[30];
    _strdate(tmpbuf);
    tmpbuf就是了。
      

  4.   

    to baizy:
    MyTimeString = MyTime.Format("%Y年%m月%d日");
    如果我想更通用一点,例如在日文操作系统上就不是"年"/"月"/"日",
    需要根据区域设置里的信息来格式化类似的字符串,怎么办?
      

  5.   


       CTime::GetYear().Format( "%Y")  + m_year 
    +  CTime::GetMonth().Format( "%M") + m_month 
    +  CTime::GetDay().Format( "%D")   + m_dayGood Luck