title: NSDate calculations summertime
body: <p>I have a timestamp (NSDate) and I want to validate if another timestamp happened in the same calendar week, month, year, day, etc.</p>
  
  <p>I tried to do this by defining 2 other NSDates, one as start date and one as end date.
  And then representing the desired timespan with these two dates. </p>
  
  <p>Example for defining the start of the current day:</p>
  
  <pre><code>NSDate *myDate = [[NSDate alloc] init];
  NSCalendar *cal = [NSCalendar currentCalendar];
  NSDateComponents *components = [cal components:(
                                                  NSEraCalendarUnit |
                                                  NSMonthCalendarUnit |
                                                  NSYearCalendarUnit |
                                                  NSDayCalendarUnit |
                                                  NSHourCalendarUnit |
                                                  NSMinuteCalendarUnit |
                                                  NSSecondCalendarUnit |
                                                  NSTimeZoneCalendarUnit
                                                  ) fromDate:myDate];
  
  [components setHour:1];
  [components setMinute:0];
  [components setSecond:0];
  startDate = [cal dateFromComponents:components];
  </code></pre>
  
  <p>This should set startDate to the time 00:00:00 on the current date.
  The problem is that this only works if myDate has current timezone. E.g. if we have winter time now, and NSDate is summer time it sets the time 1 hour wrong.</p>
  
  <p>How can I consider the summer/winter time in this calculation, or is there a better way to represent a concrete timespan a calendar based timespan a timestamp lies in?</p>