jweinst1
3/26/2016 - 5:42 AM

swift get date from string

swift get date from string

var dateAsString = "12-24-2015 23:59"
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "MM-dd-yyyy HH:mm"
var newdate = dateFormatter.dateFromString(dateAsString)