title: Date time Conversion in IOS
body: <p>I know this will be a silly question, but I tried everything and still couldn't achieve what I wanted to do.</p>
  
  <p><strong>This is my question:</strong> </p>
  
  <p>I want to check two time values and a date, I have string which is having time like this "05.30 AM". 
  I want to convert it into time format [it is better if i can convert exactly the way it is now].
  I know there is a way which can compare two time values using:</p>
  
  <p><code>NSComparisonResult result = [date1 compare:date2];</code>.</p>
  
  <p>I have followed below code to convert my string value to the time format but it is only returns null. </p>
  
  <p>Please guide me for this issue:</p>
  
  <pre><code>NSString* tim = @"11:12 AM";
  NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
  [formatter setDateStyle:NSDateFormatterShortStyle];
  
  NSDate *formatedTime= [formatter dateFromString:tim];
  NSLog(@"TIME : %@",formatedTime);
  </code></pre>