title: How to get time from YYYY-MM-dd'T'HH:mm:ss.sssZ
body: <p>Hi I want to get time as <code>11:40</code> from <code>2017-07-31T11:40:00.000Z</code></p>
  <p>Below is the code I am using:</p>
  <pre><code>let formatter = Foundation.DateFormatter()
  formatter.dateFormat = &quot;YYYY-MM-dd'T'HH:mm:ss.sssZ&quot; //2017-04-01T18:05:00.000
  let date1  = formatter.date(from: data.arvTime)
  print(&quot;date:\(String(describing: date1))&quot;)
  let dateFormatterPrint = Foundation.DateFormatter()
  dateFormatterPrint.dateFormat = &quot;HH:mm&quot;
  let resultTime = dateFormatterPrint.string(from: date1!)
  print(&quot;time:\(String(describing: resultTime))&quot;)
  </code></pre>
  <p>Getting time as <code>1:29</code> i.e. I am getting wrong time.</p>
  <p>Please help me to solve this issue.</p>