title: iOS NSDateFormatter formats incorrectly when Calendar is Japanese or Buddhist
body: <p>I'm seeing a problem with NSDateFormatter on iOS when Settings/General/International/Calendar is set to either Japanese or Buddhist on both the simulator and a real device.  It doesn’t seem to matter what the Language is set to, and the Region Format only re-arranges things (but it is still bad).  The results below are all for when 'Language' = English and 'Region Format' = Japan.</p>
  
  <p>Here's my code (ARC is enabled):</p>
  
  <pre><code>// Configure the Date Formatter
  NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  [dateFormatter setLocale:[NSLocale currentLocale]];
  [dateFormatter setDateStyle:NSDateFormatterShortStyle];
  [dateFormatter setTimeStyle:NSDateFormatterNoStyle];
  
  // Format the date string
  NSString *dateString = [dateFormatter stringFromDate:[NSDate date]];
  </code></pre>
  
  <p>And the results:</p>
  
  <ul>
  <li>iOS 4.3 (Calendar = Japanese), dateString =  “平成24/04/13”</li>
  <li>iOS 5.1 (Calendar = Japanese), dateString = “H.24/04/09”</li>
  <li>iOS 4.3 (Calendar = Buddhist), dateString =  “BE2555/04/13”</li>
  <li>iOS 5.1 (Calendar = Buddhist), dateString = “BE2555/04/13”</li>
  </ul>
  
  <p>I found this link:  <a href="http://www.cocoanetics.com/2011/12/ios-5-breaking-nsdateformatter/" rel="nofollow noreferrer">http://www.cocoanetics.com/2011/12/ios-5-breaking-nsdateformatter/</a>, which is interesting but doesn’t really point me to a solution.  I also found this: <a href="https://stackoverflow.com/questions/4677006/nsdateformatter-and-japanese-calendar">NSDateFormatter and Japanese calendar</a>, so I changed my code slightly:</p>
  
  <pre><code>[dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:[[NSLocale preferredLanguages] objectAtIndex:0]]];    
  </code></pre>
  
  <p>Then my results are this (these all seem wrong to me, that’s essentially US MM/DD/YY format):</p>
  
  <ul>
  <li>iOS 4.3 (Calendar = Japanese), dateString = “4/13/12”</li>
  <li>iOS 5.1 (Calendar = Japanese), dateString = “4/13/12”</li>
  <li>iOS 4.3 (Calendar = Buddhist), dateString = “4/13/12”</li>
  <li>iOS 5.1 (Calendar = Buddhist), dateString = “4/13/12”</li>
  </ul>
  
  <p>Of all of the results above, the only one that looks correct to me is iOS4.3 with Calendar = Japanese.</p>
  
  <p>Any ideas?</p>