i have date string 2017-01-03T10:45:00.000+02:00
and I need to transfer it to something like this 2017-01-03 10:45:00 +0200
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
// this formatter returning 2017-01-03 08:45:00 +0000 but I need
// 2017-01-03 10:45:00 +0200
Thank you for your help!
If you want to convert String to Date try the below code and let me know,
More over you can get the time from below format:
Try this:
Try this,
Swift 3.0
Result:
Date from String : Optional(2017-01-03 08:45:00 +0000)
String From Date : 2017-01-03 10:45:00 +0200
This one works for me, Hope it help's you