请给出几种方法???

解决方案 »

  1.   

    msdn里的例子:BOOL SetNewTime(WORD hour, WORD minutes)
    {
        SYSTEMTIME st;
        char *pc;    GetSystemTime(&st);       // gets current time
        st.wHour = hour;          // adjusts hours 
        st.wMinute = minutes;     // and minutes
        if (!SetSystemTime(&st))  // sets system time
            return FALSE;
        return TRUE;
    }
      

  2.   

    msdn里的例子:BOOL SetNewTime(WORD hour, WORD minutes)
    {
        SYSTEMTIME st;
        char *pc;    GetSystemTime(&st);       // gets current time
        st.wHour = hour;          // adjusts hours 
        st.wMinute = minutes;     // and minutes
        if (!SetSystemTime(&st))  // sets system time
            return FALSE;
        return TRUE;
    }
      

  3.   

    大概这样:
    查MSDN就有:SYSTEMTIME t;
    t.wMonth=10;
    t.wYear=1990;
    t.wDay=10;
    ...SetLocalTime( &t )