title: NSDateFormatter string
body: <p>What is the <code>NSDateFormatter</code> string for the following date/Time : <code>02/22/2011 10:43:00 AM</code></p>
  
  <p>Basically what I wanted was to read a string <code>02/22/2011 19:00:23 PM</code>, convert it to <code>NSDate</code> and then print is appropriately. My previous attempt:</p>
  
  <pre><code>NSDateFormatter* dtFormatter = [[NSDateFormatter alloc] init];
  [dtFormatter setDateFormat:@"MM/dd/yyyy HH:mm:ss a"];
  
  NSDate* dt3 = [dtFormatter dateFromString:@"02/22/2011 19:00:23 PM"];
  NSString* strDate3 = [dtFormatter stringFromDate:dt3];
  NSLog(@"Third = %@",strDate3);
  </code></pre>
  
  <p>Every time I tried that it would print NULL, it worked when I removed the trailing PM.</p>
  
  <p>Finally, I added the following lines right after the 2nd line in the code above:</p>
  
  <pre><code>[dtFormatter setPMSymbol:@"PM"];
  [dtFormatter setAMSymbol:@"AM"];
  </code></pre>