title: Create a NSDate with a user selected time in objective c
body: <pre><code>int hour = [[array objectAtIndex:0] intValue]; //hour = 17
  int min = [[array objectAtIndex:1] intValue]; //min = 51
  NSLog(@"hour value is %d",hour);
  NSLog(@"min value is %d",min);
  NSDateComponents *components = [[NSCalendar currentCalendar] components:NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit fromDate:[NSDate date]];
  
  int year = [components year];
  int month = [components month];
  int day = [components day];
  NSDateFormatter  *dateFormatter = [[NSDateFormatter alloc]init];
  dateFormatter.timeStyle = NSDateFormatterNoStyle;
  
  [components setYear:year];
  [components setMonth:month];
  [components setDay:day];
  [components setHour:hour];
  [components setMinute:min];
  NSCalendar *cal = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] ;
  NSDate *itemDate = [cal dateFromComponents:components];
  NSLog(@"the date is %@",itemDate);
  </code></pre>
  
  <p>Output:
  the date is 2012-11-03 01:00:00 +0000 . But i want the output to be 2012-11-03 17:51:00..how can i get it?What am i doing wrong? </p>