I need to take the NSString Dec 4, 2012, 12:33 PM and convert it to separate out the month, day, and year, so that I can have 3 different strings of 12, 04, and 2012.
I figure that I should convert the NSString to NSDate and then reformat the date to change out NSString, but am running into issues.
I have:
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"MMM dd, yyyy, hh:mm p"];
NSDate *dateFromString = [[NSDate alloc] init];
dateFromString = [dateFormatter dateFromString:substring];
NSLog(@"Date%@", dateFromString);
[dateFormatter release];
However, the date keeps coming back null.
Data Formatting Guide
. It's quite helpful about setting up different formatting: developer.apple.com/library/ios/documentation/Cocoa/Conceptual/… – Neeku