title: Calculation for start and end dates of the month are incorrect
body: <p>I have this code that is supposed to compute the start and end date of a month (the dates are used in a NSPredicate to search a CoreData store for records between the start of the month and the end of the month)</p>
  
  <pre><code>    NSDate *startOfMonth;
      NSDate *endOfMonth;
      NSCalendar *cal = [NSCalendar currentCalendar];
      NSDate *now = [NSDate date];
      NSTimeInterval interval;
  
      [cal rangeOfUnit:NSMonthCalendarUnit startDate:&amp;startOfMonth interval:&amp;interval forDate:now];
      endOfMonth = [startOfMonth dateByAddingTimeInterval:interval-1];
      NSLog(@"\n\nstartOfMonth: %@\nendOfMonth: %@\ninterval: %f",startOfMonth, endOfMonth, interval);
  </code></pre>
  
  <p>This is the output from the NSLog:</p>
  
  <pre><code>startOfMonth: 2014-11-01 07:00:00 +0000
  endOfMonth: 2014-12-01 07:59:59 +0000
  interval: 2595600.000000
  </code></pre>
  
  <p>As you can see, the <em>endOfMonth</em> is incorrect; it should be 2014-11-30... what is wrong with the code? (it isn't mine, I found it on SO)</p>
  
  <p>I changed the timeZone property of "cal," but still got the same log message.</p>