各位好:  请问如何将GetSystemTime()得到的时间转换成毫秒值。
             也就是说只要毫秒值,不要年月日小时分秒的格式,只要他们转换后的毫秒值的整数。 8个字节应该能盛下吧!!或有没有现成的函数!!!
                         谢谢!!!

解决方案 »

  1.   

    GetSystemTime()得到的时间是放在如下的一个结构体里面的,所以需要转换
    typedef struct _SYSTEMTIME
    {
       WORD   wYear;
       WORD   wMonth;
       WORD   wDayOfWeek;
       WORD   wDay;
       WORD   wHour;
       WORD   wMinute;
       WORD   wSecond;
       WORD   wMilliseconds;
    }SYSTEMTIME
    你是要把得到的年月日等都转换好秒吗?
      

  2.   

    SystemTimeToFileTimeThe SystemTimeToFileTime function converts a system time to a file time. BOOL SystemTimeToFileTime(
      CONST SYSTEMTIME *lpSystemTime,
                              // address of system time to convert
      LPFILETIME lpFileTime   // address of buffer for converted file 
                              // time
    );
     
      

  3.   

    typedef struct _SYSTEMTIME {  // st 
        WORD wYear; 
        WORD wMonth; 
        WORD wDayOfWeek; 
        WORD wDay; 
        WORD wHour; 
        WORD wMinute; 
        WORD wSecond; 
        WORD wMilliseconds; 
    } SYSTEMTIME; 
    GetSystemTime()的返回值里面就有你要的东西了
      

  4.   

    The GetTickCount function retrieves the number of milliseconds that have elapsed since the system was started. It is limited to the resolution of the system timer. To obtain the system timer resolution, use the GetSystemTimeAdjustment function. DWORD GetTickCount(VOID);
      

  5.   

    前帖回答不妥,特更正如下FILETIME ft;
    SYSTEMTIME st;GetSystemTime(&st);              // gets current time
    SystemTimeToFileTime(&st, &ft);