Converting a string to an NSDate
Solution 1:
NSString *dateStr = @"20100223";
// Convert string to date object
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"yyyyMMdd"];
NSDate *date = [dateFormat dateFromString:dateStr];
// Convert date object to desired output format
[dateFormat setDateFormat:@"EEEE MMMM d, YYYY"];
dateStr = [dateFormat stringFromDate:date];
[dateFormat release];
Hope this will help you.
Solution 2:
You'll want to take a look at NSDateFormatter. Determine the format of the date string and then use dateFromString:
to convert the string to an NSDate object.