1let isoDate = "2016-04-14T10:44:00+0000"
2
3let dateFormatter = DateFormatter()
4dateFormatter.locale = Locale(identifier: "en_US_POSIX") // set locale to reliable US_POSIX
5dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ"
6let date = dateFormatter.date(from:isoDate)!
7
8let calendar = Calendar.current
9let components = calendar.dateComponents([.year, .month, .day, .hour], from: date)
10
11let finalDate = calendar.date(from:components)