What's wrong with how I'm using NSDateFormatter?

Posted by Thom Mahoney on Stack Overflow See other posts from Stack Overflow or by Thom Mahoney
Published on 2010-06-07T22:16:41Z Indexed on 2010/06/07 22:32 UTC
Read the original article Hit count: 375

   dateFormatter = [[NSDateFormatter alloc] init];
   dateFormatter.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease];
   [dateFormatter setDateFormat:@"EEE, d MMM yyyy HH:mm:ss zzz"];
   NSString dateString = @"Tue, 08 Jun 2010 17:00:00 EDT";
   NSDate eventDate = [dateFormatter dateFromString:dateString];

In this case the eventDate object is nil. Can somebody clue me in? This code used to work.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c