title: Using Date formatter
body: <p>I have an issue with date Formatter. </p>
  
  <p>I have Two string. one string contains date in form of MM/dd/yyyy; and second string contains time in form of hh:mm a. </p>
  
  <p>Now i want to concatenate this two strings and want output as a new strings in form of 
  yyyy-MM-dd HH:mm:ss. </p>
  
  <p>I have tried following but unfortunately it doesn't work more.</p>
  
  <pre><code>-(NSString *)ConcateDateAndTime:(NSString *)date Time:(NSString *)time{
  
      date = [date stringByAppendingFormat:@" %@",time];
  
  
  
      NSDateFormatter *formater = [[NSDateFormatter alloc]init];
      [formater setDateFormat:@"MM/dd/yyyy hh:mm aa"];
  
      NSDate *dt = [NSDate date];
      dt = [formater dateFromString:date];
  
      NSDateFormatter *formater1 = [[NSDateFormatter alloc]init];
      [formater setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
  
      NSString *temp;
      temp = [formater1 stringFromDate:dt];
  
      return temp;
  
  }
  </code></pre>