Пример #1
0
        public static void RestoreSystemTime()
        {
            SYSTEMTIME st = new SystemTime.SYSTEMTIME();

            st.wYear   = currYear;
            st.wMonth  = currMonth;
            st.wDay    = currDay;
            st.wHour   = (short)DateTime.UtcNow.Hour;
            st.wMinute = (short)DateTime.UtcNow.Minute;
            st.wSecond = (short)DateTime.UtcNow.Second;
            SetSystemTime(ref st);
        }
Пример #2
0
        public static void ChangeSystemTime(int year, int month, int day)
        {
            SYSTEMTIME st = new SystemTime.SYSTEMTIME();

            st.wYear  = (short)year;
            st.wMonth = (short)month;
            st.wDay   = (short)day;



            st.wHour   = (short)DateTime.UtcNow.Hour;
            st.wMinute = (short)DateTime.UtcNow.Minute;
            st.wSecond = (short)DateTime.UtcNow.Second;

            SetSystemTime(ref st);
        }