NSString *dateStr = @"2010-06-07 19:30:18";
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-DD hh:mm:ss"];
NSDate *date = [dateFormatter dateFromString:dateStr];
date
is always nil. But the date format seems to be correct. What's wrong?
Edit: Seems to work with @"yyyy-MM-DD HH:mm:ss"