Q:

Converting String to NSDate in Swift

I have an API sending date in string with universal time but when I try to convert to NSDate format it tends to return nil. I have looked in lot of places but couldn't find a way to resolve this. Below is my code that I have written. Please help me to find where am I going wrong. The string I'm trying to convert is "Sun Feb 14 23:35:40 UTC 2016". The problem causing it to return nil is with the time zone I believe.
let dateFormatter = NSDateFormatter()
dateFormatter.timeZone = NSTimeZone(abbreviation: "UTC")
dateFormatter.dateFormat = "EEE MMM dd hh:mm:ss yyyy"
dateFormatter.dateFromString("Sun Feb 14 23:35:40 UTC 2016")

A:

Like this:
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "EEE MMM dd kk:mm:ss zzz yyyy"
let d = dateFormatter.dateFromString("Sun Feb 14 23:35:40 UTC 2016")

