WMI: Converting datetime values to DateTime objects

July 12, 2011 WMI

Just a quick post to hopefully save anyone who finds this some time. If you need to convert a datetime value from a WMI query to a native DateTime object in C#, you can use the method ToDateTime() on the ManagementDateTimeConverter class.

ManagementDateTimeConverter.ToDateTime(dmtfDate);