IOS 6 i NSDateFormatter

Oto kod:

NSString * str = @"2012-11-23Fri09:00:00+0100";

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
NSLocale *locale= [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
[formatter setLocale:locale];

[formatter setDateFormat:@"yyyy-MM-ddEEEHH:mm:ssZ"];

NSDate *result = [formatter dateFromString:str];
NSLog(@"str :%@ -- NSDate :%@", str, result);

a oto wyjście:

str :2012-11-23Fri09:00:00+0100 -- NSDate :1999-12-31 08:00:00 +0000

DlaczegoNSDate jest źle?

questionAnswers(1)

yourAnswerToTheQuestion