How can i convert the string to date and date from string?
My Input String is NSString *inputString=@"15 February 2012 17:05"; NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; [dateFormat setDateFormat:@"dd MMMM YYYY HH:mm"]; NSDate *dateVal = [dateFormat dateFromString:inputString]; NSDateFormatter *dateFormat2 = [[NSDateFormatter alloc] init]; [dateFormat2 setDateFormat:@"MM/dd/YYYY HH:mm"]; NSString *outputString = [dateFormat2 stringFromDate:dateVal]; [dateFormat release]; [dateFormat2 release]; I got the following date outputString=12/25/2011 17:05 But it should be 02/15/2012 17:05..Where did i do the mistake? You are using wrong