Ejemplo n.º 1
0
 public static SYSTEMTIME FromDateTime(DateTime dateTime)
 {
     var st = new SYSTEMTIME();
     st.wYear = (ushort)dateTime.Year;
     st.wMonth = (ushort)dateTime.Month;
     st.wDayOfWeek = (ushort)dateTime.DayOfWeek;
     st.wDay = (ushort)dateTime.Day;
     st.wHour = (ushort)dateTime.Hour;
     st.wMinute = (ushort)dateTime.Minute;
     st.wSecond = (ushort)dateTime.Second;
     st.wMilliseconds = (ushort)dateTime.Millisecond;
     return st;
 }
Ejemplo n.º 2
0
 public static extern bool SetSystemTime(ref SYSTEMTIME time);
Ejemplo n.º 3
0
 public static extern bool SetLocalTime(ref SYSTEMTIME time);
Ejemplo n.º 4
0
 public static extern void GetSystemTime(ref SYSTEMTIME time);
Ejemplo n.º 5
0
 public static extern void GetLocalTime(ref SYSTEMTIME time);