title: NSDateFormatter return nil on 2 different input which in same format?
body: <p>I am newbie of objective-c and i got this crazy problem…</p>
  
  <p>for low precision test case:</p>
  
  <blockquote>
    <p>dateString = @"2010-05-25 11:05:21", conversion success.</p>
    
    <p>dateString = @"2010-03-01 15:54:36", conversion fail.</p>
  </blockquote>
  
  <p>for high precision test case:</p>
  
  <blockquote>
    <p>dateString = @"2010-05-25 11:05:21.937113", conversion success.</p>
    
    <p>dateString = @"2010-03-01 15:54:36.937113", conversion fail.</p>
  </blockquote>
  
  <p>below is my code:</p>
  
  <pre><code>// Date formatter
   NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
   NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
   [dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
   [dateFormatter setDateFormat:@"yyyy-MM-dd hh:mm:ss.SSSSSS"];
   [dateFormatter setLocale:locale];
  
  NSDateFormatter *lowPrecisionDateFormatter = [[[NSDateFormatter alloc] init] autorelease];
  [lowPrecisionDateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
  [lowPrecisionDateFormatter setDateFormat:@"yyyy-MM-dd hh:mm:ss"];
  [lowPrecisionDateFormatter setLocale:locale];
  
  // try high precision first, if fail, then go ahead to low precision. 
  NSDate *date = [dateFormatter dateFromString:dateString];
  if(!date){
    date = [lowPrecisionDateFormatter dateFromString:dateString];
  }
  </code></pre>
  
  <p>Any help is highly appreciated!!</p>