Exemplo n.º 1
0
 /// <summary>
 /// Sets the current system time and date. 
 /// </summary>
 /// <param name="dt">The system time is expressed in Coordinated Universal Time(UTC).</param>
 public static bool SetSystemTime(DateTime dt)
 {
     SYSTEMTIME st = new SYSTEMTIME();
     st.wYear = (short)dt.Year;
     st.wMonth = (short)dt.Month;
     st.wDay = (short)dt.Day;
     st.wHour = (short)dt.Hour;
     st.wMinute = (short)dt.Minute;
     st.wSecond = (short)dt.Second;
     st.wMilliseconds = (short)dt.Millisecond;
     return SetSystemTime(ref st);
 }
Exemplo n.º 2
0
 public static extern bool SetSystemTime(ref SYSTEMTIME st);
Exemplo n.º 3
0
 public static extern bool SetSystemTime(ref SYSTEMTIME st);