How To Parse "Wed Sep 13 16:42:35 +0000 2010" in Objective C
There 开发者_StackOverflow社区just isn't a unicode format for representing months in 3 characters. It is always Sept, which is done by using MMM. What about "Sep"?
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"EEE MMM dd HH:mm:ss ZZZZ yyyy"];
NSDate *myDate = [dateFormatter dateFromString:@"Wed Sep 13 16:42:35 +0000 2010"];
this should parse your sample string nicely. I have tested it with "Sept" (four characters), it will not work. but "Sep" is just fine.
精彩评论