title: How to convert powershell UTC datetime object to EST
body: <p>I have date time strings coming in, formatted like the following:</p>
  
  <p><code>2017-08-03T12:30:00.000Z</code></p>
  
  <p>I need to be able to convert these to EST. Every function I have tried throws one error or another, typically being: </p>
  
  <p><code>"String was not recognized as a valid DateTime."</code></p>
  
  <p>I have tried variations of the below:</p>
  
  <pre><code>$time = '2017-08-03T12:30:00.000Z'
  [datetime]$datetime = $time 
  $culture = [Globalization.CultureInfo]::InvariantCulture
  [DateTime]::ParseExact($datetime, 'MM-dd-yyyy HH:mm:ss', $culture)
  </code></pre>
  
  <p>I think it has something to do with how the Date Time string I am referencing has the <code>**T**</code> and then the UTC time, but can't figure out what to do about it. Maybe I should parse out the time, convert it and then reattach to the first part of the string, the date, and combine them together for the final output? Seems like way too much work and a solution which would cause potential errors in the future.</p>