像820605256这种ULONG怎么转换成xxxxY-xxM-xxD xxH-xxM-xxS这样的格式?

解决方案 »

  1.   

    搞定了。呵呵,参考zlib的
    typedef struct tm_unz_s 
    {
    int tm_sec;
    int tm_min;
    int tm_hour;
    int tm_mday;
    int tm_mon;
    int tm_year;
    } tm_unz;void ConvertULONGTime(ULONG date, tm_unz* ptm)
    {
    uLong uDate;

    uDate = (uLong)(dosDate >> 16);
    ptm->tm_mday = (int)(uDate & 0x1F);
    ptm->tm_mon = (uInt)((((uDate) & 0x1E0) / 0x20) - 1);
    ptm->tm_year = (int)(((uDate & 0x0FE00) / 0x0200) + 1980); ptm->tm_hour = (int)((dosDate & 0xF800) / 0x800);
        ptm->tm_min = (int)((dosDate & 0x7E0) / 0x20);
        ptm->tm_sec = (int)(2 * (dosDate & 0x1f));
    }
      

  2.   

    好像用
    BOOL FileTimeToSystemTime(
      CONST FILETIME *lpFileTime,  // pointer to file time to convert
      LPSYSTEMTIME lpSystemTime    // pointer to structure to receive 
                                   // system time
    );
      

  3.   

    //COleDateTime m_BuiDate;
    CString m_strDate;
    m_strDate.Format("%d-%d-%d %s",m_BuiDate.GetYear(),
                    m_BuiDate.GetMonth(),m_BuiDate.GetDay(), 
                   (LPCTSTR)m_BuiDate.Format("%H:%M:%S"));
    MessageBox(m_strDate);