title: NSDateComponents issue - incorrect day
body: <p>I have a NSDateComponents problem. I have two NSDates that I am trying to compare by checking if their year, month and day match. This I am doing by converting the NSDate values to these integer components as follows:</p>
  
  <pre><code>//NSDate *cgiDate is previously set to 2011-08-04 00:00:00 +0000 
  //NSDate *orderDate is previously set to 2011-08-04 14:49:02 +0000
  NSCalendar *calendar = [NSCalendar currentCalendar];
  NSDateComponents *cgiDateComponents = [calendar components:( NSYearCalendarUnit | NSMonthCalendarUnit |  NSDayCalendarUnit ) fromDate:cgiDate];
  NSCalendar *orderCalendar = [NSCalendar currentCalendar];
  NSDateComponents *orderDateComponents = [orderCalendar components:( NSYearCalendarUnit | NSMonthCalendarUnit |  NSDayCalendarUnit ) fromDate:orderDate];
  if (([cgiDateComponents day] == [orderDateComponents day]) &amp;&amp;
      ([cgiDateComponents month] == [orderDateComponents month]) &amp;&amp;
      ([cgiDateComponents year] == [orderDateComponents year])) {
         GHTestLog(@"MATCHED");
   } else {
         GHTestLog(@"Not matched");
         GHTestLog(@"Day: %d vs. %d", [cgiDateComponents day], [orderDateComponents day]);
   }
  </code></pre>
  
  <p>My result is Not Matched, Day: 3 vs. 4. Why would this be?</p>
  
  <p>I have read with great interest the following questions:
  <a href="https://stackoverflow.com/questions/6885896/nsdatecomponents-day-method-returning-wrong-day">NSDateComponents - day method returning wrong day</a> and
  <a href="https://stackoverflow.com/questions/3920445/nsdatecomponents-incorrectly-reporting-day">https://stackoverflow.com/questions/3920445/nsdatecomponents-incorrectly-reporting-day</a> however neither answer my question of why this is not working.</p>
  
  <p>Any advice?</p>