title: Converting NSString to NSDate with date and time being received as different string
body: <p>I know this have been asked a lot but I am still having the problem in this conversion even after extensive search on the net. Can some one point me to my mistake in following code?</p>
  
  <pre><code>NSString *eventDttm = [[NSString alloc] init];
  eventDttm = [NSString stringWithFormat:@"%@ %@",myEvent.startDate,myEvent.timeFrom];
  NSLog(@"eventDttm: %@",eventDttm);
  
  NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
  [formatter setDateFormat:@"yyyy-MM-dd HH:MM a"];
  
  //conversion of NSString to NSDate
  
  NSDate *dateFromString = [[NSDate alloc] init];
  dateFromString = [formatter dateFromString:eventDttm];
  [formatter release];
  
  NSLog(@"%@",dateFromString);
  </code></pre>
  
  <p>I am getting date and time separately in string as following:</p>
  
  <pre><code>myEvent.startDate= 2011-11-22
  myEvent.timeFrom= 08:00 PM
  </code></pre>
  
  <p>but dateFromString is always null</p>