I want to give, for example, 12/11/2005 in the format of mm/dd/yyyy. Can I initialize 12/11/2005 to NSDate directly? Any
12/11/2005
mm/dd/yyyy
NSDate
What you need to do is something like this:
NSDateFormatter *mmddccyy = [[NSDateFormatter alloc] init]; mmddccyy.timeStyle = NSDateFormatterNoStyle; mmddccyy.dateFormat = @"MM/dd/yyyy"; NSDate *d = [mmddccyy dateFromString:@"12/11/2005"]; NSLog(@"%@", d);