This repository has been archived on 2022-08-05. You can view files and clone it, but cannot push or open issues or pull requests.
CC-Functions/W32/Time.cs
2020-05-23 17:22:45 +02:00

22 lines
614 B
C#

using CC_Functions.W32.Native;
namespace CC_Functions.W32
{
public static class Time
{
public static void Set(DateTime time)
{
time = time.ToUniversalTime();
kernel32.SYSTEMTIME st = new kernel32.SYSTEMTIME
{
wYear = (short) time.Year,
wMonth = (short) time.Month,
wDay = (short) time.Day,
wHour = (short) time.Hour,
wMinute = (short) time.Minute,
wSecond = (short) time.Second
};
kernel32.SetSystemTime(ref st);
}
}
}