Question: I am generating a report in PS and everything works fine, but when I try to use **ConvertToDateTime** to make the date readable it comes out blank? But only on Get-WmiObject **Win32\_Product** others like Win32\_Operatingsystem seem to come out fine.

```
$Install = @{n="Installed";e={$_.ConvertToDateTime($_.InstallDate)}}
$frag14 = Get-WmiObject Win32_Product -ComputerName $name | Select Name,Version,PackageName,$Install,Vendor | Sort Name | 
ConvertTo-html -Fragment 

```

Answer: 
InstallDate is just a string, it's a CIM based date string. Try this:

```
$Install = @{n="Installed";e={[DateTime]::ParseExact($_.InstallDate,'yyyyMMdd',$null)}}

```
According to the class definition of Win32\_Product see [MSDN](https://msdn.microsoft.com/en-us/library/aa394378(v=vs.85).aspx) InstallDate is a just a string, **not a CIM based string**. The string contains a date like format yyyyMMdd, ie "20170417". InstallDate2 is a CIM base datetime string. Specifically, it is a [CIM\_DateTime](https://msdn.microsoft.com/en-us/library/aa387237(v=vs.85).aspx) datatype which should contain a value in this format yyyymmddHHMMSS.mmmmmmsUUU where sUUU is time zone offset in minutes. ie 20170417101205.000000-420. 

This Win32\_Product class is recommended to vendors to populate, but sadly InstallDate2 is not required and generally always empty. Partial definition of Win32\_Product class from [MSDN](https://msdn.microsoft.com/en-us/library/aa394378(v=vs.85).aspx).

```
class Win32_Product : CIM_Product
{ uint16   AssignmentType;
  string   Caption;
  string   Description;
  string   IdentifyingNumber;
  string   InstallDate;
  datetime InstallDate2;
...

```

The following Powershell command lists *all* of your installed products with install dates (warning very slow).

```
Get-WmiObject -Class Win32_Product | Select-Object -Property Name, InstallDate, InstallDate2

```