0
Hello, I’m trying to convert a String in Date in Swift 3. However the date is always returning me with two hours more. 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")!
Exit: 2017-12-28 18:49:19 +0000
Here it looks ok: http://tpcg.io/bhwp9W. Maybe you’re misconcepting what you need to do or you have wrong computer setup Other: https://swift.sandbox.bluemix.net/#/repl/5a311de352fd1304fcf3a6c0.
– Maniero
Strange, because I am compiled on iphone and when I get Timezone, appears America/ Sao Paulo, all straight.
– Filipe Amaral Neis