I have a date string like so:
22-04-2016 8:00:00 AM
04-22-2016 8:00:00 AM
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
NSLog(@"%@", [dateFormat dateFromString:[cell scheduledDate]]);
You can say something like:
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; //Set the AM and PM symbols [dateFormatter setAMSymbol:@"AM"]; [dateFormatter setPMSymbol:@"PM"]; [dateFormatter setDateFormat:@"dd-MM-yyyy h:mm:ss a"]; NSDate *currentDate = [dateFormatter dateFromString:[cell scheduledDate]];
To get it to an NSDate. Then as matt suggests use another NSDateFormatter to get it to a different string. I agree with his objection but perhaps it is not possible to maintain the information as a date.