I receive dates as String
like this one:
"2016-05-20T12:25:00.0"
I want to get its corresponding NSDate
object, and I'm trying this way:
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "YYYY-MM-DDThh:mm:ss.s"
let date = dateFormatter.dateFromString(dateStr)
where dateStr
is like the example I wrote first. I took the dateFormat
string from this page, but I get a nil
date, what is wrong there?
Thanks in advance