我绝对不是 NSDateFormatter 或 NSDate 的新手,但这完全让我难过。我到底怎么弄错了开火日期?
NSDateFormatter *firedateFormat = [[NSDateFormatter alloc] init];
[firedateFormat setDateFormat:@"hh:mm a EEE dd MMM, YYYY"];
[firedateFormat setFormatterBehavior:NSDateFormatterBehaviorDefault];
NSDate *fireDate1 = [firedateFormat dateFromString:@"5:30 AM Sat 27 Oct, 2012"];
NSLog(@"fireDate1: %@ ...", fireDate1);
OUTPUT:
fireDate1: 2011-12-31 10:30:00 +0000 ...