iOS の NSDateFormatter で、シミュレーターと実際のデバイスの両方で Settings/General/International/Calendar が日本語または仏教徒に設定されている場合に問題が発生します。年が正しく解析されていません
DateFormatter
static NSDateFormatter *formatter = nil; // cache this the first time through
if (formatter == nil) {
formatter = [NSDateFormatter new];
formatter.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease]; // Fix for QC79748 - Michael Marceau
formatter.dateFormat = @"EEE, d MMM yyyy HH:mm:ss zzz";
formatter.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"EST"];
formatter.calendar = [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] autorelease];
formatter.locale = [[[NSLocale alloc] initWithLocaleIdentifier:[[NSLocale preferredLanguages] objectAtIndex:0]] autorelease];
}
NSLog(@"CorrectDate%@",[serviceHeaders safeObjectForKey:@"Date"] );
NSLog(@"Formatted date:%@",[formatter dateFromString:[serviceHeaders safeObjectForKey:@"Date"]]);
Output
Correct - Mon, 27 Aug 2012 16:33:14 GMT
Formatted date:0024-08-27 16:33:14 +0000