I have the following code:
NSDateFormatter * df = [[NSDateFormatter alloc] init];
[df setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
[df setTimeZone:[NSTimeZone systemTimeZone]];
[df setFormatterBehavior:NSDateFormatterBehaviorDefault];
[df dateFromString:@"2011-04-12 10:00:00"];
In which it always generates a null date. Why is this?
See Question&Answers more detail:os