I have a string like \"20121124T103000\" and I want to convert this to NSDate.
20121124T103000
NSDate
I tried converting it with dateFormatter date format \"
do like this,
NSString *dateStr = @"20121124T103000"; NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; [dateFormat setDateFormat:@"yyyyMMdd'T'hhmmss"]; NSDate *d = [dateFormat dateFromString:dateStr]; NSString *st = [dateFormat stringFromDate:d]; NSLog(@"%@",st);