I am trying to convert a date in which the javascript code is generating the current date using the Date() function. But when I print it out, I am getting nil.
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ"
let str = "2013-07-21T19:32:00Z"
if let date = dateFormatter.date(from: str) {
print(date)
}