@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: Retrieves the current system date and time in Coordinated Universal Time (UTC) format. To retrieve the current system date and time in local time, use the GetLocalTime function !!!!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: GetSystemTime@msdn on MSDN
Edit kernel32.GetSyste...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.