title: Is this the right way to add days to NSDate using NSDateComponents?
body: <p>I am using below method to add or subtract days from an NSDate.</p>
  
  <p>When I logged the values I get an unexpected result at times.</p>
  
  <p>Here is one of the case:</p>
  
  <pre><code>//This adds X days to the current Date and returns to the user
  +(NSDate*)getRelativeDateInDays:(NSInteger)days forDate:(NSDate*)date{
  
  
      NSCalendar *gregorian = [[NSCalendar alloc]initWithCalendarIdentifier:NSGregorianCalendar];
      NSDateComponents *weekdayComponents = [[NSDateComponents alloc] init];
      [weekdayComponents setDay:days];
      NSDate *newDate = [gregorian dateByAddingComponents:weekdayComponents toDate:date options:0];
      [gregorian release];
      [weekdayComponents release];
      NSLog(@"start Date : %@ End Date %@",date,newDate);
  </code></pre>
  
  <p>return newDate;
  }</p>
  
  <p><strong>CASE 1:</strong></p>
  
  <p>2012-02-17 06:28:14.474 Application[2906:707] start Date : 2012-03-08 11:26:23 +0000 End Date 2012-03-09 11:26:23 +0000 Number of days 1</p>
  
  <p><strong>CASE 2:</strong></p>
  
  <p>2012-02-17 06:29:00.631 Application[2906:707] start Date : 2012-03-10 11:26:23 +0000 End Date 2012-03-11 10:26:23 +0000 Number of days 1</p>
  
  <p>In case 1, when I added a single day to 2012-03-08 11:26:23 +0000, I get 2012-03-09 11:26:23 +0000.</p>
  
  <p>But when I add a single day to  2012-03-10 11:26:23 +0000 I get   2012-03-11 10:26:23 +0000.</p>
  
  <p><strong>1 hour is additionally reduced.</strong> What could be the problem here?
  Is any one have faced this problem?</p>