title: How to get the time in am/pm format iphone NSDateFormatter?
body: <p>Am working in an iPhone app with using the NSDateFormatter. Am getting the time from the webservice like <code>"00:00:00", "16:00:00","15:30:00" and so on</code>. I need to convert these time to 
  if the time is <code>"00:00:00" to "12 AM"</code>, if the time is <code>"16:00:00" to "4 PM"</code>, if the time is "15:30:00" to "3.30 PM". I have used the below code to this but when i have pass <code>"16:00:00" the date returns null</code>.</p>
  
  <pre><code> NSString *dats1 = @"16:00:00";
   NSDateFormatter *dateFormatter3 = [[[NSDateFormatter alloc] init] autorelease];
   [dateFormatter3 setDateStyle:NSDateFormatterMediumStyle];  
   [dateFormatter3 setDateFormat:@"hh:mm:ss"]; 
   NSDate *date1 = [dateFormatter3 dateFromString:dats1];
   NSLog(@"date1 : %@", date1); **// Here returning (null)**
  
   NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
   [formatter setDateFormat:@"hh:mm a"];
   NSLog(@"Current Date: %@", [formatter stringFromDate:date1]); **// Here also returning (null)**
   [formatter release];
  </code></pre>
  
  <p>When am passing "00:00:00" it is returning "12 AM" correctly. Can anyone please help me to solve this issue? Thanks in advance.</p>