title: NSDateFormatter producing (null) SQLite and iOS 5.1
body: <p>Maybe somebody can help explain why I am getting a null value when converting a string to a date.  It all looks right but I'm obviously missing something here.</p>
  
  <p>Some background:</p>
  
  <p>This iPad app will be used in different countries and I will need to do a calculation on the date to see if 90 days have passed since a user last logged in.</p>
  
  <p>I have a SQLite Database with a DateLastIn field set as TEXT</p>
  
  <p>My Object has a DateLastIn property set as NSDate</p>
  
  <p>When populating my record object I set up a NSDateFormatter as such..</p>
  
  <pre><code>NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
  [formatter setDateFormat:@"yyyy-MM-dd hh:mm:ss"];  // SQLite default date format
  </code></pre>
  
  <p>Then I read in the DateLastIn (Using FMDB wrapper for SQLite).</p>
  
  <pre><code>        // test SQLite as String
          NSString *testDate = [results stringForColumn:@"DateLastIn"];
          NSLog(@"DateLastIn straight from DB (string) shows %@", testDate);
  </code></pre>
  
  <p>Result: 
  <strong>DateLastIn straight from DB (string) shows 2012-04-23 18:20:51</strong></p>
  
  <p>All is good so far.  Next I test converting this to an NSDate object e.g </p>
  
  <pre><code>        NSDate *aDate = [[NSDate alloc] init];
          aDate = [formatter dateFromString:testDate];
          NSLog(@"Using formmater on string date results in: %@", aDate);
  </code></pre>
  
  <p>Result:
  <strong>Using formmater on string date results in: (null)</strong></p>
  
  <p>I have tried DATETIME in SQLite, I've tried using NSString in my object instead of NSDate and seem to be going around in circles.  </p>
  
  <p>Any help much appreciated.</p>