可以这样写:
SYSTEMTIME  st;
GetLocalTime(&st);

解决方案 »

  1.   

    time()按F1获得帮助,同时可获得其它相关函数如localtime()
      

  2.   

    利用CTIME类,可查看MSDN呀!
    CTime currenttime=CTime::GetCurrentTime();
    currenttime.format(yourformat)
    即可
      

  3.   

    利用CTime 的函数 GetCurrentTime() 即可返回当前时间
      

  4.   

    用:
    CTime currenttime = CTime::GetCurrentTime();
    CString m_createtime = currenttime.Format("%#Y/%#m/%#d");
    得:
    2001/05/17
    哈哈...............
      

  5.   

    VOID GetSystemTime(    LPSYSTEMTIME lpSystemTime  // address of system time structure  
       );
      

  6.   

    to kane_yj
    用currenttime.Format()怎样能获得时、分、秒?谢谢!
      

  7.   

    用API函数GetLocalTime()最好!