title: Trying to convert array of strings to date
body: <p>I'm running into a weird issue where I'm trying to parse an array of the following strings, which have been given the variable <code>$DatesUnformatted</code>:</p>
  
  <pre><code>2020-02-28T05:29:00Z
  2020-02-28T04:52:00Z
  2020-02-28T04:52:00Z
  2020-02-27T17:01:00Z
  2020-02-27T17:01:00Z
  2020-02-27T17:01:00Z
  2020-02-27T17:01:00Z
  </code></pre>
  
  <p>...to a time format (<code>hh:mm tt</code>) using <code>[DateTime]::ParseExact()</code>.</p>
  
  <p>My script looks like something like this:</p>
  
  <pre class="lang-bsh prettyprint-override"><code>foreach ($DateUnformatted in $DatesUnformatted)
  {
      $DateFormatted = [datetime]::parseexact($DateUnformatted, 'yyyy-MM-ddThh:mm:ssZ',$null).ToString('hh:mm tt')
      echo "Converting $DateUnformatted to $DateFormatted"
  }
  </code></pre>
  
  <p>And here's the output:</p>
  
  <pre><code>Converting 2020-02-28T05:29:00Z to 12:29 AM
  Converting 2020-02-28T04:52:00Z to 11:52 PM
  Converting 2020-02-28T04:52:00Z to 11:52 PM
  Converting 2020-02-27T17:01:00Z to 11:52 PM
  Converting 2020-02-27T17:01:00Z to 11:52 PM
  Converting 2020-02-27T17:01:00Z to 11:52 PM
  Converting 2020-02-27T17:01:00Z to 11:52 PM
  </code></pre>
  
  <p>It seems like it's only converting the first few entries then just repeating one until the end of the loop. Any ideas?</p>