title: Converting a 24 hour format date string to Date and it does not match
body: <p>I am converting this 24 hour format string <code>"2019-01-10 21:00:40"</code> to a Date object but what I am getting is this <code>2019-01-10 13:00:40</code>. I am using the format <code>yyyy-MM-dd HH:mm:ss</code> to convert the string to date object. What seems to be the problem here?</p>
  
  <p>I am using this String Extension to convert string to date:</p>
  
  <pre><code>    func toDateWithFormat(_ format:String) -&gt; Date{
      let dateFormatter = DateFormatter()
      dateFormatter.dateFormat = format
      guard let date = dateFormatter.date(from: self) else {
          fatalError("ERROR: Date conversion failed due to mismatched format.")
      }
      return date
  }
  </code></pre>