@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The GetTimeFormat API !!!!C# Signature: [DllImport("kernel32.dll")] static extern int GetTimeFormat(uint locale, uint dwFlags, ref SystemTime time, string format, StringBuilder sb, int sbSize); !!!!User-Defined Types: SYSTEMTIME in Win32 is different then DateTime in CLR. This structure may represent SYSTEMTIME in CLR world: [StructLayout(LayoutKind.Sequential)] private struct SystemTime { [MarshalAs(UnmanagedType.U2)] public ushort Year; [MarshalAs(UnmanagedType.U2)] public ushort Month; [MarshalAs(UnmanagedType.U2)] public ushort DayOfWeek; [MarshalAs(UnmanagedType.U2)] public ushort Day; [MarshalAs(UnmanagedType.U2)] public ushort Hour; [MarshalAs(UnmanagedType.U2)] public ushort Minute; [MarshalAs(UnmanagedType.U2)] public ushort Second; [MarshalAs(UnmanagedType.U2)] public ushort Milliseconds; } !!!!Notes: Win32 interprets format differently than CLR does so if you don't need exactly Win32 compatible behavior use DateTime.ToString() instead. !!!!Tips & Tricks: Please add some! !!!!Sample Code: (see sample code for GetDateFormat()) !!!!Alternative Managed API: DateTime.ToString(string format, IFormatProvider provider); Documentation: GetTimeFormat@msdn on MSDN
Edit kernel32.GetTimeF...
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.