title: Time conversion from String to Date: 12 is becoming 00 swift
body: <p>I am saving a time to Firebase and then allowing the user to reload the time that was saved.</p>
  
  <p>When I pull the data from the server (as a String) and then convert the time back to a Date type, it changes from 12:00 (Midday) to 00:00 (Midnight).</p>
  
  <p>I can see the data on my Firebase realtime Database and it clearly says 12:00 and not midnight.</p>
  
  <p><a href="https://i.stack.imgur.com/dNjO0.png" rel="nofollow noreferrer">Firebase Image</a></p>
  
  <p>Here is the code I am using to extract the data from the dictionary I've downloaded from the real-time Database.</p>
  
  <pre><code>if let gtt1hourLabTime = patientDataDictionary["1 Hour lab Time"] as? String {
        if let realgtt1HourLabTime = timeFormatTool(gtt1hourLabTime) {
                  print(realgtt1HourLabTime)
                  patientVC.gtt1HourLabTime = realgtt1HourLabTime
         }
  }
  </code></pre>
  
  <p>Here is my time format Tool:</p>
  
  <pre><code>func timeFormatTool(_ dateStr: String) -&gt; Date? {
          let simpleDateFormat = DateFormatter()
          simpleDateFormat.dateFormat = "hh:mm"
  
          let date = simpleDateFormat.date(from: dateStr)
          return date
  }
  </code></pre>
  
  <p>When the time is printed it comes out like this:</p>
  
  <pre><code>2000-01-01 00:18:00 +0000
  </code></pre>