getsystemtime (kernel32)
Last changed: -84.131.214.178

.
Summary

C# Signature:

[DllImport("kernel32.dll")]
static extern void GetSystemTime(out SystemTime t);

User-Defined Types:

[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;
}

Notes:

https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtime

Tips & Tricks:

Please add some!

Sample Code:

[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);

Alternative Managed API:

Do you know one? Please contribute it!

Documentation