NSDateFormatter dateFromString:stringDate returning nil in iOS 8.3
问题 I have this code NSString *stringDate = @"2015-07-09 7:00 AM"; NSString *stringDateFormat = @"yyyy-MM-dd h:mm a"; NSTimeZone *timeZone = [NSTimeZone localTimeZone]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter setTimeZone:timeZone]; [dateFormatter setDateFormat:stringDateFormat]; NSDate *dateFormatted = [dateFormatter dateFromString:stringDate]; The problem now is dateFormatted keeps getting nil value. It is OK when I try it in Simulator iPhone5s 8.2 but, the