I am trying to convert a date from a String to NSDate with the following code:
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "E, dd MMM yyyy, KK:mma"
date = dateFormatter.dateFromString(strDate)
I have also tried the following formats:
- EEE, dd MMM yyyy, hh:mma
- EEE, dd MMM yyyy, KK:mm
but the out put is always nil
Converted Tue, 12 Jan 2016, 7:30am to nil with the formatter E, dd MMM yyyy, KK:mma
I have also considered the follow StackOverflow posts:
and I have been using this link as a reference for the date formats