title: How to get the hours,minute and am/pm from a date?
body: <p>I tried to extract hours,minute and am/pm from date but i am getting NULL output. I have shown below my code, please review it.</p>
  
  <pre><code>NSString *dateStr=@"29/07/2013 02:00am";
  NSDateFormatter * formatter=[[NSDateFormatter alloc] init];
  [formatter setDateFormat:@"hh:mmaa"];
  NSDate *date=[formatter dateFromString:dateStr];
  NSString *finalDate=[formatter stringFromDate:date];
  NSLog(@"%@",finalDate);
  </code></pre>
  
  <p>Many thanks in advance</p>