Possible Duplicate:
Converting NSString to NSDate (and back again)
I have a NSString representation of a date and time as such: 6/06/2012 5:55:15 PM
It comes from an external source and I do not have the ability to edit it. If possible I wish to convert this to a NSDate object using the NSDateFormatter. I tried using the code below but I'm getting nowhere fast, the resultant date object is null, does anyone have any idea? I'm guessing I'm leaving something important out to handle the AM/PM.
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"dd/MM/yyyy HH:mm:ss"];
NSDate *currentDate = [formatter dateFromString:job.jobDate];
NSLog(@"currentDate = %@",currentDate); // is null