Hello, I'm trying to convert a String to Date in Swift 3. But the date is always returning me two more hours. Below is my code.
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "dd-MM-yyyy HH:mm:ss"
dateFormatter.locale = Locale(identifier: "pt_BR")
let date:Date = dateFormatter.date(from:"12-12-2017 16:49:19")!
Output: 2017-12-28 18:49:19 +0000