I have a string like " 20121124T103000 " and I want to convert it to NSDate .
I tried converting it to the dateFormatter date format " yyyyMMddThhmmss ", but it gives a result like 2001-01-01 00:00:00 +0000 , which is incorrect.
How can we convert this string to NSDate ?
Here is my code:
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; [dateFormat setDateFormat:@"yyyyMMddThhmmss"]; NSLog(@"%@",[dateFormat dateFromString:@"20121124T103000"]);
Any help is appreciated.
source share