Esempio n. 1
0
        public static DateTime GetLocalTime()
        {
            var time = new SystemDate();
            Win32.GetSystemTime(ref time);

            var dt = time.ToDateTime();

            return dt;
        }
Esempio n. 2
0
        public static DateTime GetLocalTime()
        {
            var time = new SystemDate();
            Win32.GetSystemTime(ref time);

            var dt = time.ToDateTime();

            return dt;
        }
Esempio n. 3
0
        public static SystemDate FromDateTime(DateTime dateTime)
        {
            var time = new SystemDate();

            time._year         = (ushort)dateTime.Year;
            time._month        = (ushort)dateTime.Month;
            time._dayOfWeek    = (ushort)dateTime.DayOfWeek;
            time._day          = (ushort)dateTime.Day;
            time._hour         = (ushort)dateTime.Hour;
            time._minute       = (ushort)dateTime.Minute;
            time._mecond       = (ushort)dateTime.Second;
            time._milliseconds = (ushort)dateTime.Millisecond;

            return(time);
        }
Esempio n. 4
0
        public static SystemDate FromDateTime(DateTime dateTime)
        {
            var time = new SystemDate();

            time._year = (ushort)dateTime.Year;
            time._month = (ushort)dateTime.Month;
            time._dayOfWeek = (ushort)dateTime.DayOfWeek;
            time._day = (ushort)dateTime.Day;
            time._hour = (ushort)dateTime.Hour;
            time._minute = (ushort)dateTime.Minute;
            time._mecond = (ushort)dateTime.Second;
            time._milliseconds = (ushort)dateTime.Millisecond;

            return time;
        }
Esempio n. 5
0
 public static extern void GetLocalTime(ref SystemDate time);
Esempio n. 6
0
 public static extern bool SetLocalTime(ref SystemDate time);
Esempio n. 7
0
 public static extern bool SetSystemTime(ref SystemDate time);
Esempio n. 8
0
 public static extern void GetSystemTime(ref SystemDate time);
Esempio n. 9
0
        public static void SetSystemTime(DateTime dt)
        {
           var time = SystemDate.FromDateTime(dt);

           Win32.SetSystemTime(ref time);
        }