Swift 2.0 String to NSDate
问题 Hello i get my date from Datepicker that gets saved to a string then uploaded to Firebase. The string is then recieved to the phone. The problem is that i want to convert this string to NSDate when i retrieve it. This is how i get a string from datepicker func datePickerChanged(datePicker:UIDatePicker){ var dateFormatter = NSDateFormatter() dateFormatter.dateStyle = NSDateFormatterStyle.ShortStyle dateFormatter.timeStyle = NSDateFormatterStyle.ShortStyle var strDateFrom = dateFormatter