I am converting date from NSString to NSDate using following code
NSString *dateString = @"julho-29-2012 05:01 PM";
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"dd-MM-yyyy hh:mm:ss a"];
NSDate* dateFromString = [dateFormatter dateFromString:dateString];
NSLog(@"%@",dateFromString);
[dateFormatter release];
But it not working for me 🙁
Your date format string doesn’t match the date format in the string.
Try:
Setting the locale should only be needed if your phone is not in Portuguese already.