Use the following solution
NSString *str = @"3/15/2012 9:15 PM";
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"MM/dd/yyyy HH:mm a";
NSDate *date = [formatter dateFromString:str];
NSLog(@"%@", date);
Edit:
Sorry, the format should be as follows:
formatter.dateFormat = @"MM/dd/yyyy hh:mm a";
And the time shown will be GMT time. So if you add/subtract the timezone, it would be 9:15 PM.
Edit: #2
Use as below. You would get exact time too.
NSString *str = @"3/15/2012 9:15 PM";
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"MM/dd/yyyy hh:mm a";
NSTimeZone *gmt = [NSTimeZone timeZoneWithAbbreviation:@"GMT"];
formatter.timeZone = gmt;
NSDate *date = [formatter dateFromString:str];
NSLog(@"%@",date);