I get the date in NSString format as below.
Entrance: datestring = 04/30/2013 04:49 PM
I am using the NSDateformatter format as follows to convert this NSString to NSDate.
Format: dateFormat = dd / MM / yyyy hh: mm a
I still get date conversion to Nil. Please help as I do not understand this problem. Here is my code snippet to explain what I do in a utility function.
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:dateFormat];
NSDate *date = [dateFormatter dateFromString:dateString];
return date;
source
share