CTime tmCur=CTime::GetCurentTime();
CString strFilename;tmCur.Format()

解决方案 »

  1.   

    补充freetime(gaoshou) 
    strFilename = tmCur.Format(“自己设置”)
    strFilename += "扩展名"
      

  2.   

    CString strVal=CTime::GetCurrentTime().Format("%m%d%H%M%S.bmp");
    char *strFileName=strVal.GetBuffer(strVal.GetLength());
      

  3.   

    楼上说法都可以实现,这里有一些我用过的代码,可以显示一些与众不同的效果1、如果使用COleDateTime类来取得时间,还可以使时间显示为中文格式,不用自己变换,作为文件名也许更好一些(代码摘自“问专家”http://askpro.yeah.net)
        setlocale( LC_TIME, "chinese-simplified"); 
         // 设 置 为 简 体 中 文 显 示 方 式 
         
        COleDateTime dateTmp = COleDateTime::GetCurrentTime (); 
        CString strWeekDayName = dateTmp.Format (_T ("%a")); 
         
        setlocale( LC_ALL, "C"); // 恢 复 为 缺 省 设 置 2、另外如果要显示时间为下列格式hh:mm:ss,那么就要注意文件名中的不能有的一些非法字符"\/:*?"<>|"了,可以将这些非法字符转换成相应的中文字符即可