title: Powershell ParseExact Date formatting yyyyMMdd issue
body: <p>Good afternoon,</p>
  
  <p>Can someone tell me how to convert the date 20120624 into yyyyMMdd using powershell as I get "String was not recognised as a valud datetime" when running the following code</p>
  
  <pre><code>[String]$ServiceTag = "b26ybt1";
  
  Try{ 
         $AssetService = New-WebServiceProxy -Uri "http://xserv.dell.com/services/AssetService.asmx?WSDL"; 
         $ApplicationName = "AssetService"; 
         $Guid = [Guid]::NewGuid(); 
         $Asset = $AssetService.GetAssetInformation($Guid,$ApplicationName,$ServiceTag); 
         $Writer = New-Object "System.IO.StringWriter"; 
         $XmlSerializer = New-Object System.Xml.Serialization.XmlSerializer($Asset.GetType()); 
         $XmlSerializer.Serialize($Writer,$Asset); 
         [String]$Result = $Writer.ToString(); 
         $Writer.Flush(); 
         $Writer.Close(); 
         Return $Result; 
  } 
  Catch{ 
         Write-Host $($_.Exception.Message);     
  }
  
  $prog = [regex]::match($Result,'(?&lt;=StartDate&gt;)(.*)(?=T00)').Groups[1].Value
  [System.Text.RegularExpressions.Regex]::Replace($prog,"[-]","");
  
  [datetime]::ParseExact($prog,"yyyyMMdd",$null)
  </code></pre>