title: How to Format Unknown Date Format in Objective-C
body: <p>I've probably overlooked something simple, but I can't figure out how to convert a specific date format in Objective-C. I'm receiving dates in this format:</p>
  
  <p><strong>Sun, 10 Oct 2010 01:44:00 +0000</strong></p>
  
  <p>And I need to convert it to a long format with no time, like this:</p>
  
  <p><strong>October 10, 2010</strong></p>
  
  <p>I've tried using NSDateFormatter, but when I try to get a date from the string, it always comes back nil. I've tried it this way:</p>
  
  <pre><code>NSString *dateFromData = [articleData objectAtIndex:5];
  NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
  
  [dateFormatter setDateStyle:NSDateFormatterLongStyle];
  [dateFormatter setTimeStyle:NSDateFormatterNoStyle];
  NSDate *date = [dateFormatter dateFromString:dateFromData];  
  
  NSString *formattedDateString = [dateFormatter stringFromDate:date];
  </code></pre>
  
  <p>The date string always comes back nil. Am I missing something simple here?</p>