[DllImport("kernel32.dll")]
static extern void GetSystemTime(out SystemTime t);
[StructLayout(LayoutKind.Sequential)]
struct SystemTime
{
public ushort Year;
public ushort Month;
public ushort DayOfWeek;
public ushort Day;
public ushort Hour;
public ushort Minute;
public ushort Second;
public ushort Milliseconds;
}
https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtime
Please add some!
[DllImport("kernel32.dll")]
static extern void GetSystemTime(out SystemTime t);
SystemTime t = new SystemTime();
GetSystemTime(out t); // If SystemTime is of type struct we have to use out
Console.WriteLine(t.Year);
Do you know one? Please contribute it!