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

            var dt = time.ToDateTime();

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

            var dt = time.ToDateTime();

            return dt;
        }
Beispiel #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);
        }
Beispiel #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;
        }
Beispiel #5
0
 public static extern void GetLocalTime(ref SystemDate time);
Beispiel #6
0
 public static extern bool SetLocalTime(ref SystemDate time);
Beispiel #7
0
 public static extern bool SetSystemTime(ref SystemDate time);
Beispiel #8
0
 public static extern void GetSystemTime(ref SystemDate time);
Beispiel #9
0
        public static void SetSystemTime(DateTime dt)
        {
           var time = SystemDate.FromDateTime(dt);

           Win32.SetSystemTime(ref time);
        }