Convert WMI Win32_OperatingSystem InstallDate to mm/dd/yyyy format (C# – WPF)

The System.Management.ManagementDateTimeConverter class was made to solve your problem. Use its ToDateTime() method. It properly parses milliseconds and the UTC offset in the string:

  DateTime dt = System.Management.ManagementDateTimeConverter.ToDateTime("20100131022308.000000-360");
  Console.WriteLine(dt);

Output:
1/31/2010 2:23:08 AM

Leave a Comment