请问:
    我用 CTime time;
         time=GetCurrentTime();得到了时间,但我想用messagebox把它显示出来,应该怎么去写代码呢?谢谢指教!

解决方案 »

  1.   

    看能不能先将它转换成CString.
      

  2.   

    http://www.csdn.net/Develop/Read_Article.asp?id=12365
    http://www.vckbase.com/study/article/data_convert.htm
      

  3.   

    CString Hour;
    CString Min;
    CString Sec;
    Hour.Format("%d", time.GetHour());
    Min.Format("%d", time.GetMiniute());
    Sec.Format("%d", time.GetSecond());
    MessageBox(Hour+Min+Sec,"ok",MB_OK);
      

  4.   

    See the sample below , just what u want :http://www.codeproject.com/datetime/dtconverter.asp
      

  5.   

    CTime::Format()
    CTime::FormatGmt()
    可以将他转换成串。