如题

解决方案 »

  1.   

    CTime time=CTime::GetCurrentTime();
    CString TimeText=time.Format("%Y年%m月%d日");
      

  2.   

    GetSystemTime
    This function retrieves the current system date and time. The system time is expressed in Coordinated Universal Time (UTC). void GetSystemTime( 
    LPSYSTEMTIME lpSystemTime ); Parameters
    lpSystemTime 
    [out] Pointer to a SYSTEMTIME structure to receive the current system date and time.
     
    Return Values
    None.
      

  3.   

    或者time_t CStnTimerWnd::GetCurrTime(void)
    {
    time_t tmRetVal=0; ::time(&tmRetVal);           // Get time as long integer.     return tmRetVal; 
    }
      

  4.   

    http://www.vctop.com/View.Asp?ID=246&CateID=1
      

  5.   

    void GetSysTime(CString &StrTime)
    {
    CTime time = CTime::GetCurrentTime();
    int year,month,day,hour,minute,second;
    year = time.GetYear();
    day = time.GetDay();
    month = time.GetMonth();
    hour = time.GetHour();
    minute = time.GetMinute();
    second = time.GetSecond();
    CString m_time;
    CString strsql;
    m_time.Format("%d-%d-%d %d:%d:%d",year,month,day,hour,minute,second);
    StrTime = m_time;
    }
      

  6.   

    CTime t = CTime::GetCurrentTime();strTime.Format("%02d-%02d-%02d %02d:%02d:%02d",t.GetYear(),
    t.GetMonth(),t.GetDay(),t.GetHour(),t.GetMinute(),t.GetSecond());
    AfxMessageBox(strTime);