title: NSDateFormatter returns nil for @"dd-MM-yy" in iOS 3.0
body: <p>I have this part of code:</p>
  
  <pre><code>NSDate *date =nil;
  NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  [dateFormatter setDateStyle:NSDateFormatterMediumStyle];
  [dateFormatter setDateFormat:@"dd-MM-yy"];
  date = [dateFormatter dateFromString:inString];
  [dateFormatter release];
  </code></pre>
  
  <p>It works perfectly fine, as expected in iOS 4.0. But the same code doesnt in 3.0.</p>
  
  <p>The string which I am getting, is like "12-Nov-10" and this is contained in inString pointer.</p>
  
  <p>The date formatter returns nil if the native OS is 3.0 or 3.1. For some reasons I need to stick to the same date format. Has anyone else faced this problem? Any suggestions to resolve this issue?</p>
  
  <p>Thanks,</p>
  
  <p>Raj</p>
  
  <p><strong>Edit:</strong>
  The proper code, after following suggestions pointed out by Harkonian and the Q&amp;A discussions:</p>
  
  <pre><code>NSDate *date =nil;
  NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  [dateFormatter setDateStyle:NSDateFormatterMediumStyle];
  [dateFormatter setDateFormat:@"dd-MMM-yy"];
  
  NSLocale *enUSPOSIXLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];
  [dateFormatter setLocale:enUSPOSIXLocale];
  [enUSPOSIXLocale release];
  
  date = [dateFormatter dateFromString:inString];
  [dateFormatter release];
  </code></pre>