title: objective-c: converting date string into day of the week + month name
body: <p>A beginner's problem, but I was wondering if anyone could help me with this:</p>
  
  <p>I need to set four strings according to a string which contains a certain date (e.g. @"Apr 7, 2011"):</p>
  
  <ul>
  <li>a string which will take the day of the week (abbreviated: Mon, Tue, Wed, Thu, Fri, Sat, Sun): e.g. <code>@"Thu"</code></li>
  <li>a string which will take the day, e.g. <code>@"7"</code></li>
  <li>a string which will take the month, e.g. <code>@"April"</code></li>
  <li>and a string which will take the year, e.g. <code>@"2011"</code></li>
  </ul>
  
  <hr>
  
  <p>So far, I found this:</p>
  
  <pre><code>    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  [dateFormatter setTimeStyle:NSDateFormatterNoStyle];
  [dateFormatter setDateStyle:NSDateFormatterMediumStyle];
  
  NSDate *date = [NSDate dateWithTimeIntervalSinceReferenceDate:118800];
  
  NSLocale *usLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
  [dateFormatter setLocale:usLocale];
  
  NSLog(@"Date for locale %@: %@",
        [[dateFormatter locale] localeIdentifier], [dateFormatter stringFromDate:date]);
  // Output:
  // Date for locale en_US: Jan 2, 2001
  </code></pre>
  
  <hr>
  
  <p>So this would give me a certain formatted date. I was wondering, however, how I can access certain parts of this date. There is the - (NSArray *)weekdaySymbols but I have no idea how to work this one and the documentation is quite frugal. </p>
  
  <p>Any hints from calendar experts would be very welcome.</p>
  
  <hr>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I guess this is part of the solution:</p>
  
  <pre><code>    NSLocale *gbLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_GB"];
  NSString *gbFormatString = [NSDateFormatter dateFormatFromTemplate:@"EdMMM" options:0 locale:gbLocale];
  NSLog(@"gbFormatterString: %@", gbFormatString);
  // Output: gbFormatterString: EEE d MMM, e.g. Thu 7 Apr
  </code></pre>