title: Error in dat conversion IOS
body: <p>I am using <code>UIDatePicker</code> to get the date of birth of a person and display it in the format <code>January 19, 2012</code>. I am using the following function to convert the date returned by the date picker to the string format:</p>
  
  <pre><code>-(NSString*)stringFromDate:(NSDate *)date
  {
      NSDateFormatter *formater =[[NSDateFormatter alloc]init];
      [formater setDateFormat:@"MMMM dd, YYYY"];
  
      NSString *str = [formater stringFromDate:date];
      return str;    
  }
  </code></pre>
  
  <p>It is working correctly and I am getting the correct date converted to string. Now for calling the web service to save this dat, I am again converting this string into dat using the same date formatter format as shown below:</p>
  
  <pre><code>- (NSDate *)dateFromString:(NSString *)string
  {
      NSDateFormatter *formater =[[NSDateFormatter alloc]init];
      [formater setDateFormat:@"MMMM dd, YYYY"];
      NSDate *date = [formater dateFromString:string];
      return date;
  }
  </code></pre>
  
  <p>But now, if the date I selected is <code>October 18, 2006</code> The above function returns the date as <code>2005-12-24 18:30:00 +0000</code>, which is <code>December 25, 2005</code> when converted to string using the first function. Even though I am using the same dat formatter, why is this happening in different cases?</p>