title: DatePicker showing previous date
body: <pre><code>-(IBAction)pickerChanged:(id)sender
  {
  UIDatePicker *picker = (UIDatePicker *)sender;
  NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
  //NSDate *dateSelected is declared in .h file
  self.dateSelected = [picker date];
  if(self.textField.tag == 101)
  self.textField.text = [dateFormatter stringFromDate:self.dateSelected];
  
  nslog(@"date = %@",self.textField.text);
  nslog(@"dateSelected = %@",self.dateSelected);
  }
  </code></pre>
  
  <p>both textfield.text and date selected should be same but, in the output log....if i get date = 2-1-2012 i am getting dateselected = 1-1-2012...and the date is getting saved as 1-1-2012.i am not able to figure out the problem.</p>