0

I have a date in swift of type string with this format: "2020-06-20T15:40:22+02:00". If I run the code:

let dateFormatter = DateFormatter ()
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss ZZZ"
let date = dateFormatter.date (from: (2020-06-20T15:40:22+02:00))
print (date)

I get: 2020-06-20 13:40:22 +0000 2 hours less. How can I apply offset to date? Thank you.

0 Answers0